@Service
class GropiusUserService(repository: GropiusUserRepository, val gropiusCoreConfigurationProperties: GropiusCoreConfigurationProperties) : NodeService<GropiusUser, GropiusUserRepository>

Service for GropiusUsers. Provides functions to create and update

Parameters

repository

the associated repository used for CRUD functionality

gropiusCoreConfigurationProperties

the configuration properties

Constructors

Link copied to clipboard
constructor(repository: GropiusUserRepository, gropiusCoreConfigurationProperties: GropiusCoreConfigurationProperties)

Properties

Link copied to clipboard
@Autowired
lateinit var authorizationChecker: AuthorizationChecker

Injected, used for the checkPermission function

Link copied to clipboard

Injected, used to get a user based on a GropiusAuthorizationContext

Link copied to clipboard

Functions

Link copied to clipboard
suspend fun checkIsAdmin(authorizationContext: GropiusAuthorizationContext, errorMessage: String)

Checks if the user defined by authorizationContext is a global admin

Link copied to clipboard
suspend fun checkPermission(node: Node, permission: Permission, errorMessage: String)

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

Link copied to clipboard

Creates a new GropiusUser based on the provided input Does not check the authorization status Checks that no GropiusUser with the same username exists This MUST NOT be exposed via the public API

Link copied to clipboard
suspend fun evaluatePermission(node: Node, permission: Permission): Boolean

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

Link copied to clipboard

Finds a GropiusUser by username No authorization status check necessary

Link copied to clipboard
suspend fun findGropiusUserIds(): List<ID>

Find the ids of all GropiusUsers

Link copied to clipboard
suspend fun getUser(authorizationContext: GropiusAuthorizationContext): GropiusUser

Gets a GropiusUser based on the userId from the authorizationContext

Link copied to clipboard

Updates a GropiusUser based on the provided input Checks the authorization status

Link copied to clipboard
suspend fun validateAvatar(avatar: URI)

Validates that a URI can be used as avatar for a GropiusUser