Service for ComponentPermissions. Provides functions to create, update and delete
Parameters
the associated repository used for CRUD functionality
used to get Components by id
Properties
Injected, used for the checkPermission function
Injected, used to get a user based on a GropiusAuthorizationContext
Functions
Checks if the user defined by authorizationContext is a global admin
Checks if the permission is granted on node If checkPermission on the permission.context is false, no permission is evaluated Does not handle the case that the user is an admin
Creates a new ComponentPermission based on the provided input Checks the authorization status
Creates the default ComponentPermission The created permission grants ADMIN and READ only to the provided user Does not check permissions or save the created permission / component
Creates the default permission on node creation The created permission grants ADMIN and READ only to the provided user Does not check permissions or save the created permission
Creates a subtype of NodePermission Checks the authorization status
Deletes a NodePermission by id Checks the authorization status
Ensures that at least one permission on node grants NodePermission.ADMIN to at least one user
Evaluates if the permission is granted on node If checkPermission on the permission.context is false, no permission is evaluated Does not handle the case that the user is an admin
Gets a GropiusUser based on the userId from the authorizationContext
Updates a NodePermission based on the provided input Checks the authorization status
Adds/Removes permissions to/from a NodeWithPermissions Checks permissions on addedPermissions, but not on node Checks that at least one user has still NodePermission.ADMIN on node