Interface ServicePermission
-
- All Known Subinterfaces:
ServicePermissionForHierarchy
public interface ServicePermission
Attached to a legacy user service definition, this interface specifies the conditions under which this service can be executed.From release 5.8.0, it is strongly advised to use the new
UserService
API, which allows to use the more powerfulServicePermissionRule
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" />
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>
param1
andparam2
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:
ServiceContext
, Legacy User services
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ActionPermission
getPermission(SchemaNode aNode, Adaptation aDataSetOrRecord, Session aSession)
Returns a permission for the specified arguments.
-
-
-
Method Detail
-
getPermission
ActionPermission getPermission(SchemaNode aNode, Adaptation aDataSetOrRecord, Session aSession)
Returns a permission for the specified arguments.
If this
ServicePermission
is 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,
aDataSetOrRecord
is 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,
aDataSetOrRecord
is the current record. - To evaluate the permission to execute, in any context;
in this case,
aDataSetOrRecord
is 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,null
if 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,
-
-