User
Users are the basic subject of role-based authorization. They are generic in their type of UserId and tenant id.
Aside from their identity, users contain their assigned Roles and Permissions which can be checked by AuthorizationPolicies.
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
User.type
Members list
Type members
Classlikes
A user in the bounded context of role-based authorization.
A user in the bounded context of role-based authorization.
tenantId
is optional since superusers will not belong to any tenant. User-models for single-tenant systems can use Nothing
as the type for the tenantId.
Attributes
- Example
-
Example usage without tenantId
case class ExampleUser(id: String, roles: Set[Role], permissions: Set[(Permission, ResourceSelector[_, _])], otherData: String) extends User[String, Nothing]: val tenantId: Option[Nothing] = None
Example usage with UUID for id and tenantId
case class ExampleUser( id: UUID, tenantId: Option[UUID], roles: Set[Role], permissions: Set[(Permission, ResourceSelector[_, _])], otherData: String ) extends User[UUID, UUID]
- Companion
- object
- Supertypes
- Known subtypes
-
trait UserWithoutTenantId[I]
Types
Users can be identified by a java.util.UUID, scala.Symbol, String, java.lang.Number, or a scala.Product with a scala.Serializable.
Users can be identified by a java.util.UUID, scala.Symbol, String, java.lang.Number, or a scala.Product with a scala.Serializable.