public interface ServicePermission
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.
A service permission must be declared within a
Legacy user services declaration,
in the attribute class
:
where<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:
where<osd:service resourcePath="/myFirstPage.jsp" class="com.foo.MyPermission" > <param1>...</param1> <param2>...</param2> </osd:service>
param1
and param2
are JavaBean properties of the class specified.
For more information, see the JavaBean specification.
setParam1(...)
and
setParam2(...)
).
getPermission(SchemaNode, Adaptation, Session)
is called each time the associated service is potentially displayed in a user interface session.
ServiceContext
,
Legacy User servicesModifier and Type | Method and Description |
---|---|
ActionPermission |
getPermission(SchemaNode aNode,
Adaptation aDataSetOrRecord,
Session aSession)
Returns a permission for the specified arguments.
|
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:
aDataSetOrRecord
is the current dataset.aDataSetOrRecord
is the current record.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.
For a single instance of this interface, this method can be called concurrently by several threads.
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.