To define the right set of policies its important to understand how ranger policy engine evaluates the policies.
Once the list of tags for the requested resource are found, Apache Ranger policy engine will evaluate the tag-based-policies applicable for the tags.
1. If a policy for one of these tag results in deny, the access will be denied.
2. If none of the tags are denied and if a policy allows for one of the tags, the access will be allowed.
3. If there is no result for any tag or if there are no tags for the resource, the policy engine will evaluate the resource-based policies to make the authorization decision.
For masking,
To exclude specific users/groups from column-masking, create a policy-item for specific users/groups with ‘Unmasked’ as the masking option and ensure that the policy-item is the first one to appear in the list for the users/groups.
I hope this helps.