Interface ServicePermissionRule<S extends EntitySelection>
public interface ServicePermissionRule<S extends EntitySelection>
This interface can be implemented to specify the conditions under which
a user service can be displayed and executed.
A class implementing this interface can be declared at two levels:
- as a global permission rule, when declared within the service declaration via API;
- as a data model local permission rule, when set in a schema extension; a local rule only applies in its data model assigned context.
For more information, see the Programmatic permission on service documentation.
- Since:
- 5.8.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ServicePermissionRule<EntitySelection>
Always returns the disabled permission (i.e both for display and execution contexts).static final ServicePermissionRule<EntitySelection>
Always returns the enabled permission (i.e for both display and execution contexts).static final ServicePermissionRule<EntitySelection>
Returns the disabled permission for display context, but returns enabled for execution. -
Method Summary
Modifier and TypeMethodDescriptiongetPermission
(ServicePermissionRuleContext<S> aContext) Returns a permission for the specified context.
-
Field Details
-
ALWAYS_ENABLED
Always returns the enabled permission (i.e for both display and execution contexts). -
ENABLED_FOR_EXECUTION_ONLY
Returns the disabled permission for display context, but returns enabled for execution. -
ALWAYS_DISABLED
Always returns the disabled permission (i.e both for display and execution contexts).
-
-
Method Details
-
getPermission
Returns a permission for the specified context.This method is called to evaluate permissions in two cases:
- on display of a button or a menu item launching the service;
- on launch of the service.
Multi-threading
This method can be called simultaneously by several threads.
- Parameters:
aContext
- the current context in which the permission has to be resolved.
-