NIHVIVO-2476 DisplayRestrictedDataByRoleLevelPolicy should treat self-editors like the public. Let policies that are specifically for self-editors handle the interesting logic.

This commit is contained in:
j2blake 2011-07-14 17:51:22 +00:00
parent 094e6010dd
commit cf42178977

View file

@ -51,6 +51,14 @@ public class DisplayRestrictedDataByRoleLevelPolicy implements PolicyIface {
} }
RoleLevel userRole = HasRoleLevel.getUsersRoleLevel(whoToAuth); RoleLevel userRole = HasRoleLevel.getUsersRoleLevel(whoToAuth);
/*
* This policy treats a self-editor as no better than public. If you
* want self-editors to see their own properties, some other policy must
* grant that.
*/
if (userRole == RoleLevel.SELF) {
userRole = RoleLevel.PUBLIC;
}
PolicyDecision result; PolicyDecision result;
if (whatToAuth instanceof DisplayDataProperty) { if (whatToAuth instanceof DisplayDataProperty) {