Interface AuthorizationService
- All Superinterfaces:
Service
Technical service for checking authorization on service or entity level for the current user.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptioncom.sap.cds.ql.cqn.CqnPredicatecalcWhereCondition(String entityName, String event) Calculates aCqnPredicatewhich reflects the 'where' conditions for the given entity and event.booleanhasActionAccess(String entityName, String actionName) Checks if the current user is allowed to access the given action.booleanhasEntityAccess(String entityName, String event) Checks if the current user is allowed to access the given entity.booleanhasEntityAccess(String entityName, String event, com.sap.cds.ql.cqn.CqnStatement query) Checks if the current user is allowed to access the entity via the given query.booleanhasFunctionAccess(String entityName, String functionName) Checks if the current user is allowed to access the given function.booleanhasServiceAccess(String serviceName, String event) Checks if the current user is allowed to access the given service.
-
Field Details
-
DEFAULT_NAME
- See Also:
-
EVENT_SERVICE_ACCESS
- See Also:
-
EVENT_ENTITY_ACCESS
- See Also:
-
EVENT_FUNCTION_ACCESS
- See Also:
-
EVENT_ACTION_ACCESS
- See Also:
-
EVENT_CALC_WHERE_CONDITION
- See Also:
-
-
Method Details
-
hasServiceAccess
Checks if the current user is allowed to access the given service. Services might be restricted on basis of roles and events.- Parameters:
serviceName- The (fully-qualified) name of the serviceevent- The event- Returns:
truein case of permission,falseotherwise
-
hasEntityAccess
Checks if the current user is allowed to access the given entity. Entities might be restricted on basis of roles, events and instance based conditions.- Parameters:
entityName- The (fully-qualified) name of the entityevent- The event- Returns:
truein case of permission,falseotherwise
-
hasEntityAccess
Checks if the current user is allowed to access the entity via the given query. Authorizations for auto-exposed entities may be derived from an entity on the path. Entities might be restricted on basis of roles, events and instance based conditions.- Parameters:
entityName- The (fully-qualified) name of the entityevent- The eventquery- The query defining the access path- Returns:
truein case of permission,falseotherwise
-
hasFunctionAccess
Checks if the current user is allowed to access the given function. Functions might be restricted on basis of roles or instance based conditions.- Parameters:
entityName- The (fully-qualified) name of the entity in case of bound functionfunctionName- The name of the function, full-qualified in case of unbound function- Returns:
truein case of permission,falseotherwise
-
hasActionAccess
Checks if the current user is allowed to access the given action. Actions might be restricted on basis of roles or instance based conditions.- Parameters:
entityName- The (fully-qualified) name of the entity in case of bound actionactionName- The name of the action, full-qualified in case of unbound action- Returns:
truein case of permission,falseotherwise
-
calcWhereCondition
Calculates aCqnPredicatewhich reflects the 'where' conditions for the given entity and event.- Parameters:
entityName- The (fully-qualified) name of the entityevent- The event- Returns:
- The predicate or
nullif there is no limitation
-