public interface SchemaExtensionsContext
AccessRule
/AccessRuleForCreate
to restrict access on data;ServicePermissionRule
to restrict access on available services;UserServiceDeclaration
to declare a user service.Modifier and Type | Method and Description |
---|---|
SchemaNode |
getSchemaNode()
Returns the root node of the data model.
|
<S extends EntitySelection,T extends ActivationContext<S>> |
registerUserService(UserServiceDeclaration<S,T> aNewUserServiceDeclaration)
Registers a new user service for the current data model in EBX®.
|
void |
registerUserServiceExtension(UserServiceExtensionDeclaration aUserServiceExtensionDeclaration)
Registers a new user service extension for the current data model in EBX®.
|
void |
setAccessRuleForCreateOnNode(Path aPath,
AccessRuleForCreate aRule)
Declares that the access to a record node may be
restricted by the specified rule while in a record creation context.
|
void |
setAccessRuleForCreateOnNodeAndAllDescendants(Path aSubTreePath,
boolean includeRoot,
AccessRuleForCreate aRule)
Declares that the access to an element's subtree may be
restricted in a record creation context by the specified
AccessRuleForCreate . |
void |
setAccessRuleOnInstance(AccessRule aRule)
Declares that global access to a dataset may be
restricted by the specified rule.
|
void |
setAccessRuleOnNode(Path aPath,
AccessRule aRule)
Declares that the access to an element may be
restricted by the specified rule.
|
void |
setAccessRuleOnNodeAndAllDescendants(Path aSubTreePath,
boolean includeRoot,
AccessRule aRule)
Declares that the access to an element's subtree may be
restricted by the specified rule.
|
void |
setAccessRuleOnOccurrence(Path aTablePath,
AccessRule aRule)
Declares that global access to a table record in the data model may be
restricted by the specified rule.
|
void |
setServicePermissionRuleOnNode(Path aPathInSchema,
ServiceKey aServiceKey,
ServicePermissionRule<? extends EntitySelection> aRule)
Declares that the display and execution of the specified service is
conditioned by the specified rule, when invoked on the element referred
by the specified path.
|
void |
setServicePermissionRuleOnNodeAndAllDescendants(Path aSubTreePathInSchema,
ServiceKey aServiceKey,
ServicePermissionRule<? extends EntitySelection> aRule)
Declares that the display and execution of the specified service is
conditioned by the specified rule, for all elements matching the rule's
type of
EntitySelection under the specified data model element. |
SchemaNode getSchemaNode()
void setAccessRuleOnInstance(AccessRule aRule)
SchemaNode
provided
in the rule will always be the root node.
Attention: Only one AccessRule
can be associated with a data model
regarding the access to its datasets. Thus, if a rule has previously been set
using this method, it will be replaced by the current one.
aRule
- the rule to be setsetAccessRuleOnNode(Path, AccessRule)
,
setAccessRuleOnOccurrence(Path, AccessRule)
,
AccessRule.getPermission(com.onwbp.adaptation.Adaptation, Session, SchemaNode)
void setAccessRuleOnNode(Path aPath, AccessRule aRule)
Attention: Only one AccessRule
can be specified for a
terminal element. As a consequence:
AccessRule
has previously been set on
the element, it will be replaced by the current one;
When a rule is not defined at a given level, it is considered to be
AccessRule.ALWAYS_READ_WRITE
at that level.
At runtime, the effective access permission for an element is the most restrictive permission of the following:
AccessRule
attached to the dataset
containing the element (see
setAccessRuleOnInstance(AccessRule)
);AccessRule
attached to the record
containing the element, if the element is in a table (see
setAccessRuleOnOccurrence(Path, AccessRule)
).AccessRule
attached to the element, as set by this method;AccessRuleForCreate
attached to the element, as set by
setAccessRuleForCreateOnNode(Path, AccessRuleForCreate)
;aPath
- the location of the element on which to set the ruleaRule
- the rule to be setvoid setAccessRuleOnNodeAndAllDescendants(Path aSubTreePath, boolean includeRoot, AccessRule aRule)
Attention: Only one AccessRule
can be specified for a
terminal element.
As a consequence, if an AccessRule
has previously been set on
any node in the specified sub-tree, it will be replaced by the specified one.
aSubTreePath
- the root of the sub-tree on which to set the ruleincludeRoot
- specifies whether the root is also to have the rule setaRule
- the rule to setsetAccessRuleOnNode(Path, AccessRule)
void setAccessRuleForCreateOnNode(Path aPath, AccessRuleForCreate aRule)
See setAccessRuleOnNode(Path, AccessRule)
for more information
about permission evaluation.
Attention: Only one AccessRuleForCreate
can be specified for a
terminal element under a table.
As a consequence:
AccessRuleForCreate
has previously been set on
the element, it will be replaced by the current one;void setAccessRuleForCreateOnNodeAndAllDescendants(Path aSubTreePath, boolean includeRoot, AccessRuleForCreate aRule)
AccessRuleForCreate
. Only record
terminal nodes will be affected by the specified rule.
Attention: Only one AccessRuleForCreate
can be specified for a
terminal element under a table.
As a consequence, if an AccessRuleForCreate
has previously been set on
any node in the specified sub-tree, it will be replaced by the specified one.
aSubTreePath
- the root of the sub-tree on which to set the ruleincludeRoot
- specifies whether the root is also to have the rule setaRule
- the rule to setsetAccessRuleForCreateOnNode(Path, AccessRuleForCreate)
void setAccessRuleOnOccurrence(Path aTablePath, AccessRule aRule)
Attention 1: When dealing with large volume, it is highly recommended to use scripting record access rule instead.
Attention 2: Only one rule can be associated with a table at a given path for access to its records. Thus, if a rule has already been set, it will be replaced by the current one.
At runtime, the effective access permission to a table record is the most restrictive permission of the following:
AccessRule
attached to the dataset
containing the table (see
setAccessRuleOnInstance(AccessRule)
);AccessRule
and/or
scripting record access rule attached to the record
containing the element.
When a rule is not defined at a given level, it is considered to be
AccessRule.ALWAYS_READ_WRITE
at that level.
aTablePath
- location of the table elementaRule
- the rule to setAccessRule.getPermission(com.onwbp.adaptation.Adaptation, Session, SchemaNode)
void setServicePermissionRuleOnNode(Path aPathInSchema, ServiceKey aServiceKey, ServicePermissionRule<? extends EntitySelection> aRule)
Attention: Only one rule can be associated with a path. Thus, if a rule has previously been set on the element, it will be replaced by the current one.
When the element specified by the path is a dataset,
the specified rule can only be a ServicePermissionRule<DatasetEntitySelection>
,
in which case the rule will be evaluated when the selection is this
dataset.
When the element specified by the path is a table, the specified rule can either be:
ServicePermissionRule<TableViewEntitySelection>
or
a ServicePermissionRule<RecordEntitySelection>
,
in which case the rule will be evaluated when the selection is:
For a ServicePermissionRule<RecordEntitySelection>
,
the provided context is more limited than the one provided in a
ServicePermissionRule<TableViewEntitySelection>
, but it is
also easier to use when working on a single record base.
ServicePermissionRule<HierarchyEntitySelection>
,
in which case the rule will only be evaluated when the selection is
a hierarchy with this table as target table.
ServicePermissionRule<HierarchyNodeEntitySelection>
,
in which case the rule will only be evaluated when the selection is
a hierarchy node representing a record of this table.
When the element specified by the path is an association, the specified rule can either be:
ServicePermissionRule<AssociationEntitySelection>
,
in which case the rule will only be evaluated when the selection is
this association.
ServicePermissionRule<AssociationRecordEntitySelection>
,
in which case the rule will only be evaluated when the selection is
a linked record by this association.
A data model compilation error is added:
EntitySelection
parameter
does not match the element referred by the specified path
(see previous section).aPathInSchema
- the location of the element on which to set the ruleaServiceKey
- the key of the service on which the rule will applyaRule
- the rule to be setIllegalArgumentException
- if:
Path
is null
.ServiceKey
is null
.ServicePermissionRule
is null
.ServicePermissionRule.getPermission(ServicePermissionRuleContext)
,
Programmatic activation on
service,
Resolving permissions for
servicesvoid setServicePermissionRuleOnNodeAndAllDescendants(Path aSubTreePathInSchema, ServiceKey aServiceKey, ServicePermissionRule<? extends EntitySelection> aRule)
EntitySelection
under the specified data model element.
Attention: Only one rule can be associated with an element. Thus, if a rule has previously been set for any element in the specified sub-tree, it will be replaced by the specified rule. For this reason, the order in which rules are set is important.
The rule will be set on table elements only, when the specified rule is either:
ServicePermissionRule<TableViewEntitySelection>
ServicePermissionRule<RecordEntitySelection>
,ServicePermissionRule<HierarchyEntitySelection>
ServicePermissionRule<HierarchyNodeEntitySelection>
The rule will be set on association elements only, when the specified rule is either:
ServicePermissionRule<AssociationEntitySelection>
ServicePermissionRule<AssociationRecordEntitySelection>
aSubTreePathInSchema
- the root of the sub-tree on which to set the ruleaServiceKey
- the key of the service on which the rule will applyaRule
- the rule to setsetServicePermissionRuleOnNode(Path, ServiceKey, ServicePermissionRule)
,
ServicePermissionRule.getPermission(ServicePermissionRuleContext)
<S extends EntitySelection,T extends ActivationContext<S>> void registerUserService(UserServiceDeclaration<S,T> aNewUserServiceDeclaration)
void registerUserServiceExtension(UserServiceExtensionDeclaration aUserServiceExtensionDeclaration)
Only built-in services and services declared in the current data model can be extended using this method.