Interface AuthorizationService
- All Superinterfaces:
Service
Technical service for checking authorization on service or entity level for the current user.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.sap.cds.ql.cqn.CqnPredicate
calcWhereCondition
(String entityName, String event) Calculates aCqnPredicate
which reflects the 'where' conditions for the given entity and event.boolean
hasActionAccess
(String entityName, String actionName) Checks if the current user is allowed to access the given action.boolean
hasEntityAccess
(String entityName, String event) Checks if the current user is allowed to access the given entity.boolean
hasEntityAccess
(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.boolean
hasFunctionAccess
(String entityName, String functionName) Checks if the current user is allowed to access the given function.boolean
hasServiceAccess
(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:
true
in case of permission,false
otherwise
-
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:
true
in case of permission,false
otherwise
-
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:
true
in case of permission,false
otherwise
-
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:
true
in case of permission,false
otherwise
-
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:
true
in case of permission,false
otherwise
-
calcWhereCondition
Calculates aCqnPredicate
which 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
null
if there is no limitation
-