Interface ServicePermission
- All Known Subinterfaces:
ServicePermissionForHierarchy
From release 5.8.0, it is strongly advised to use the new UserService API,
which allows to use the more powerful ServicePermissionRule interface.
Refer to the
current documentation on user services
for more information.
Data model definition
A service permission must be declared within a
Legacy user services declaration,
in the attribute class:
<osd:service
resourcePath="/myFirstPage.jsp"
class="com.foo.MyPermission" />
where com.foo.MyPermission is
the fully qualified name of a class implementing this interface.
It is also possible to set additional JavaBean properties:
<osd:service
resourcePath="/myFirstPage.jsp"
class="com.foo.MyPermission" >
<param1>...</param1>
<param2>...</param2>
</osd:service>
where param1 and param2 are JavaBean properties of the class specified.
For more information, see the JavaBean specification.
Life cycle
- When the data model is loaded, on each node that declares a specific permission,
the class specified is instantiated through its default
constructor and the JavaBean property
setters are called (in the example above,
setParam1(...)andsetParam2(...)). - During the operational phase: the method
getPermission(SchemaNode, Adaptation, Session)is called each time the associated service is potentially displayed in a user interface session.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetPermission(SchemaNode aNode, Adaptation aDataSetOrRecord, Session aSession) Returns a permission for the specified arguments.
-
Method Details
-
getPermission
Returns a permission for the specified arguments.
If this
ServicePermissionis defined for a user service on a record or record selection, this method is called in multiple contexts:- To evaluate the permission to display in the table view toolbar;
in this case,
aDataSetOrRecordis the current dataset. - To evaluate the permission to display in the record view, or as a button embedded in the row of a tabular
view;
in this case,
aDataSetOrRecordis the current record. - To evaluate the permission to execute, in any context;
in this case,
aDataSetOrRecordis the current record.If the service is invoked on a selection of records, it is evaluated for each of them and the evaluation will stop on the first 'disabled' result.
Multi-threading
For a single instance of this interface, this method can be called concurrently by several threads.
- Parameters:
aNode- the current node on which the service is to be executed,nullif the execution is at the whole dataset level.aDataSetOrRecord- the current dataset or record on which the service is to be executed.aSession- the current session in which the permission has to be resolved.
- To evaluate the permission to display in the table view toolbar;
in this case,
-