AuthorizeByTenantIdOrSuperRolePolicy

mbauer83.zio_http_authorization.AuthorizationPolicy$.AuthorizeByTenantIdOrSuperRolePolicy
See theAuthorizeByTenantIdOrSuperRolePolicy companion object
class AuthorizeByTenantIdOrSuperRolePolicy[U <: User[_, _], R <: Resource[_]] extends AuthorizationPolicy[U, R]

An AuthorizationPolicy that authorizes access if and only if either of the following conditions is met:

Attributes

Companion
object
Graph
Supertypes
trait AuthorizationPolicy[U, R]
class Object
trait Matchable
class Any

Members list

Type members

Inherited types

type ResourceType = R

Attributes

Inherited from:
AuthorizationPolicy
type UserType = U

Attributes

Inherited from:
AuthorizationPolicy

Value members

Concrete methods

def authorized[Res <: R | Iterable[R]](user: U)(resource: Res): ZIO[Any, UserNotAuthorizedForResourceException[_], Res]

An effect which either fails with a UserNotAuthorizedForResourceException or succeeds with the resource if the user is authorized to access the resource.

An effect which either fails with a UserNotAuthorizedForResourceException or succeeds with the resource if the user is authorized to access the resource.

If the resource is an scala.collection.Iterable, the effect must fail if and only if the user is not authorized to access any of the resources in the collection. Otherwise, it must succeed with a filtered version of the resource.

Attributes