protected void validate() { ensureOnlyOneNotNull("Authorization must either have a 'userId' or a 'groupId'.", authorization.getUserId(), authorization.getGroupId()); ensureNotNull("Authorization 'resourceType' cannot be null.", "authorization.getResource()", authorization.getResource()); }
protected void validate() { ensureOnlyOneNotNull("Authorization must either have a 'userId' or a 'groupId'.", authorization.getUserId(), authorization.getGroupId()); ensureNotNull("Authorization 'resourceType' cannot be null.", "authorization.getResource()", authorization.getResource()); }
protected boolean hasEntitySameAuthorizationRights(AuthorizationEntity authEntity, String userId, String groupId, Resource resource, String resourceId) { boolean sameUserId = areIdsEqual(authEntity.getUserId(), userId); boolean sameGroupId = areIdsEqual(authEntity.getGroupId(), groupId); boolean sameResourceId = areIdsEqual(authEntity.getResourceId(), (resourceId)); boolean sameResourceType = authEntity.getResourceType() == resource.resourceType(); boolean sameAuthorizationType = authEntity.getAuthorizationType() == AUTH_TYPE_GRANT; return sameUserId && sameGroupId && sameResourceType && sameResourceId && sameAuthorizationType; }
protected boolean hasEntitySameAuthorizationRights(AuthorizationEntity authEntity, String userId, String groupId, Resource resource, String resourceId) { boolean sameUserId = areIdsEqual(authEntity.getUserId(), userId); boolean sameGroupId = areIdsEqual(authEntity.getGroupId(), groupId); boolean sameResourceId = areIdsEqual(authEntity.getResourceId(), (resourceId)); boolean sameResourceType = authEntity.getResourceType() == resource.resourceType(); boolean sameAuthorizationType = authEntity.getAuthorizationType() == AUTH_TYPE_GRANT; return sameUserId && sameGroupId && sameResourceType && sameResourceId && sameAuthorizationType; }
protected void validate() { ensureOnlyOneNotNull("Authorization must either have a 'userId' or a 'groupId'.", authorization.getUserId(), authorization.getGroupId()); ensureNotNull("Authorization 'resourceType' cannot be null.", "authorization.getResource()", authorization.getResource()); }
protected boolean hasEntitySameAuthorizationRights(AuthorizationEntity authEntity, String userId, String groupId, Resource resource, String resourceId) { boolean sameUserId = areIdsEqual(authEntity.getUserId(), userId); boolean sameGroupId = areIdsEqual(authEntity.getGroupId(), groupId); boolean sameResourceId = areIdsEqual(authEntity.getResourceId(), (resourceId)); boolean sameResourceType = authEntity.getResourceType() == resource.resourceType(); boolean sameAuthorizationType = authEntity.getAuthorizationType() == AUTH_TYPE_GRANT; return sameUserId && sameGroupId && sameResourceType && sameResourceId && sameAuthorizationType; }