protected boolean isGlobalPermission(final int permissionId) { return Permissions.isGlobalPermission(permissionId); }
/** * Retrieves all the entites for this permission and then removes them. * * @param scheme to remove entites from must NOT be null * @param permissionId to remove must NOT be a global permission * @return True is all the entities are removed * @throws RemoveException */ @Override public boolean removeEntities(final GenericValue scheme, final Long permissionId) throws RemoveException { if (Permissions.isGlobalPermission(permissionId.intValue())) { throw new IllegalArgumentException("PermissionId passed must not be a global permissions " + permissionId.toString() + " is global"); } final boolean result = super.removeEntities(scheme, permissionId); schemeEntityCache.remove(getSchemeEntityCacheKey(scheme)); return result; }
public boolean hasPermission(PermissionManager manager, ApplicationUser user, Project project) { for (int permission : permissions) { if (Permissions.isGlobalPermission(permission)) { if (manager.hasPermission(permission, user)) { return true; } } else { if (manager.hasPermission(new ProjectPermissionKey(permission), project, user)) { return true; } } } return false; } }
return new VoteContext(PASS); if (Permissions.isGlobalPermission(permission))