Package org.cyclos.impl.access
Interface AuthHandler
-
public interface AuthHandlerHandles authentication and authorization for the current logged user
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description UserRelationshipgetRelationship(BasicUser basicUser, BasicUser related)Returns the relationship level between 2 usersCollection<?>getRequiredValues(Permission permission)Returns the required values to be enforced on the given permission.default booleanhasValue(Permission permission, Object... values)Returns whether the logged user has access to ALL the given values for the given permission.booleanisAdminOf(User admin, BasicUser user)Returns whether the given user is an administrator of the given user.booleanisBrokerOf(BasicUser broker, BasicUser user)Returns whether the given user is a broker of the given user.booleanmanages(BasicUser manager, BasicUser basicUser)Returns whether the first user manages the second user.UserPermissionCheckpermission(BasicUser user)Returns anUserPermissionCheckfor the logged user over the given userPermissionCheckpermission(Permission permission)Returns aPermissionCheckfor the logged user with a permission which is not related to usersUserPermissionCheckpermissionOptionalValue(BasicUser user)Returns anUserPermissionCheckfor the logged user over the given user, optionally checking related valuesPermissionCheckpermissionOptionalValue(Permission permission)Returns aPermissionCheckwhich can check any type of permission and, optionally, related values.booleanrelatesTo(BasicUser basicUser, BasicUser related)Returns whether the first user is related to (is allowed to view) the second userbooleanrequiresValues(Permission permission)Returns whether the given permission would require a value check for the currently logged user
-
-
-
Method Detail
-
getRelationship
UserRelationship getRelationship(BasicUser basicUser, BasicUser related)
Returns the relationship level between 2 users
-
getRequiredValues
Collection<?> getRequiredValues(Permission permission)
Returns the required values to be enforced on the given permission. Required values are obtained from permissions which are granted / denied according to a collection of related entities on products. For example, the permission to perform a payment comes from having related payment types.
-
hasValue
default boolean hasValue(Permission permission, Object... values)
Returns whether the logged user has access to ALL the given values for the given permission. If the permission is not related to values, returns false
-
isAdminOf
boolean isAdminOf(User admin, BasicUser user)
Returns whether the given user is an administrator of the given user. An administrator is never an administrator of himself.
-
isBrokerOf
boolean isBrokerOf(BasicUser broker, BasicUser user)
Returns whether the given user is a broker of the given user. A broker is never a broker of himself.
-
manages
boolean manages(BasicUser manager, BasicUser basicUser)
Returns whether the first user manages the second user. A user or any of his operators (restricted or not) always manages himself (i.e operator.manages(owner) is true).
-
permission
UserPermissionCheck permission(BasicUser user)
Returns anUserPermissionCheckfor the logged user over the given user
-
permission
PermissionCheck permission(Permission permission)
Returns aPermissionCheckfor the logged user with a permission which is not related to users
-
permissionOptionalValue
UserPermissionCheck permissionOptionalValue(BasicUser user)
Returns anUserPermissionCheckfor the logged user over the given user, optionally checking related values
-
permissionOptionalValue
PermissionCheck permissionOptionalValue(Permission permission)
Returns aPermissionCheckwhich can check any type of permission and, optionally, related values. Never checks users.
-
relatesTo
boolean relatesTo(BasicUser basicUser, BasicUser related)
Returns whether the first user is related to (is allowed to view) the second user
-
requiresValues
boolean requiresValues(Permission permission)
Returns whether the given permission would require a value check for the currently logged user
-
-