Class AbstractEntityRuleProvider
java.lang.Object
ch.tocco.nice2.rest.entity.api.ruleprovider.AbstractEntityRuleProvider
- All Implemented Interfaces:
RuleProvider
- Direct Known Subclasses:
OwnTimetableRuleProvider
,PresenceCheckRuleProvider
-
Constructor Summary
ConstructorDescriptionAbstractEntityRuleProvider
(TypeManager typeManager, DataModel dataModel, FormModel formModel, QueryBuilderFactory queryBuilderFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Per default access to the entities used for generating reports is granted.final void
createRulesForRequest
(Principal principal, PolicyBuilder policyBuilder) protected Condition
getKeyCondition
(String relation, List<PrimaryKey> keys) Helper method which returns the key condition for a relationprotected void
grantActionAccess
(PolicyBuilder policyBuilder, String... actionIds) protected void
grantCreateAccess
(PolicyBuilder policyBuilder, String... models) protected void
grantEntityReadAccess
(PolicyBuilder policyBuilder, String model, Condition condition) Helper method to grant read access to entities of a model which match the condition.protected void
grantEntityWriteAccess
(PolicyBuilder policyBuilder, String model, Condition condition) Helper method to grant write access to entities of a model which match the condition.protected void
grantEntityWriteAccessForPaths
(PolicyBuilder policyBuilder, String model, Condition condition, String... paths) Helper method to grant write access for specific paths for entities of a model which match the condition.protected void
grantFullReadAccess
(PolicyBuilder policyBuilder, String model) Helper method to grant full (= all paths) read to all entities of a model.protected void
grantReportingAccess
(PolicyBuilder policyBuilder) protected List
<PrimaryKey> loadRelatedKeys
(String targetModel, String relation, List<PrimaryKey> sourceKeys) Helper method which returns the primary keys of the related source keysvoid
rulesForRequest
(Principal principal, PolicyBuilder policyBuilder) Implement specific rules for this rule provider.void
setRuleProviderContributions
(List<RuleProviderContribution> contributions) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ch.tocco.nice2.web.core.api.ruleprovider.RuleProvider
getId
-
Constructor Details
-
AbstractEntityRuleProvider
public AbstractEntityRuleProvider(TypeManager typeManager, DataModel dataModel, FormModel formModel, QueryBuilderFactory queryBuilderFactory)
-
-
Method Details
-
createRulesForRequest
- Specified by:
createRulesForRequest
in interfaceRuleProvider
-
rulesForRequest
Implement specific rules for this rule provider. -
allowReportingAccess
protected boolean allowReportingAccess()Per default access to the entities used for generating reports is granted. However this can be disabled here -
grantFullReadAccess
Helper method to grant full (= all paths) read to all entities of a model. -
grantActionAccess
-
grantCreateAccess
-
grantEntityReadAccess
protected void grantEntityReadAccess(PolicyBuilder policyBuilder, String model, Condition condition) Helper method to grant read access to entities of a model which match the condition. Paths which are not whitelisted via contribution are not readable. -
grantEntityWriteAccess
protected void grantEntityWriteAccess(PolicyBuilder policyBuilder, String model, Condition condition) Helper method to grant write access to entities of a model which match the condition. Paths which are not whitelisted via contribution are not readable. -
grantEntityWriteAccessForPaths
protected void grantEntityWriteAccessForPaths(PolicyBuilder policyBuilder, String model, Condition condition, String... paths) Helper method to grant write access for specific paths for entities of a model which match the condition. -
loadRelatedKeys
protected List<PrimaryKey> loadRelatedKeys(String targetModel, String relation, List<PrimaryKey> sourceKeys) Helper method which returns the primary keys of the related source keys -
getKeyCondition
Helper method which returns the key condition for a relation -
grantReportingAccess
-
setRuleProviderContributions
-