class RelatedToNodePermissionRuleGenerator(val nodePermissionDefinition: NodeDefinition) : NodePermissionRuleGenerator

Permission rule generator which checks for a Node that is related via a NodePermission which provides a specific permission (specified by permission.name) to the User. Additional permission names can be provided via the parameters of the Rule. In this case, it is sufficient if ANY of the permissions is granted. Requires a GropiusAuthorizationContext as authorization context

As an example: If the following relations and nodes exist:

(c:Component)<-[:NODE]-(cp:ComponentPermission)<-[:PERMISSIONS]-(g:GropiusUser)

If the id of g is provided via the context, and "READ" is in the entries of cp, the permission "READ" is granted on c

Parameters

nodePermissionDefinition

the definition of the NodePermission related to the node on which the permission is checked and the GropiusUser

Constructors

Link copied to clipboard
constructor(nodePermissionDefinition: NodeDefinition)

Properties

Link copied to clipboard
private val nodePermissionDefinition: NodeDefinition

Functions

Link copied to clipboard
fun generatePredicateCondition(nodePermissionNode: Node, permission: Permission, permissionNames: List<String>): Condition

Generates the condition for the authorization Is meant to be used in the where part of an existential subquery If any permission in permissionNames is present, the condition evaluates to true

Link copied to clipboard
open override fun generateRule(node: Node, rule: Rule, permission: Permission): Condition