UserContext

bolster.security.UserContext
See theUserContext companion object
sealed trait UserContext extends SecurityContext

Defines user context in which a set of permissions is granted.

Attributes

See also
Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def grant(perms: Set[Permission]): UserContext

Creates new security context by adding supplied permissions to existing set of permissions.

Creates new security context by adding supplied permissions to existing set of permissions.

Value parameters

perms

permissions

Attributes

Returns

new security context

def grant(one: Permission, more: Permission*): UserContext

Creates new security context by adding supplied permissions to existing set of permissions.

Creates new security context by adding supplied permissions to existing set of permissions.

Value parameters

more

additional permissions

one

permission

Attributes

Returns

new security context

Gets permissions.

Gets permissions.

Attributes

def revoke(perms: Set[Permission]): UserContext

Creates new security context by removing supplied permissions from existing set of permissions.

Creates new security context by removing supplied permissions from existing set of permissions.

Value parameters

perms

permissions

Attributes

Returns

new security context

Creates new security context by removing supplied permissions from existing set of permissions.

Creates new security context by removing supplied permissions from existing set of permissions.

Value parameters

more

additional permissions

one

permission

Attributes

Returns

new security context

Inherited methods

def all[T](one: Permission, more: Permission*)(op: => T): T

Tests permissions before applying operation.

Tests permissions before applying operation.

If all supplied permissions are granted, the operation is applied; otherwise, SecurityViolation is thrown.

Value parameters

more

additional permissions

one

permission

op

operation

Attributes

Returns

operation value

Throws
SecurityViolation

if all permissions are not granted

Note

Operation is authorized if perms is empty.

Inherited from:
SecurityContext
def all[T](perms: Set[Permission])(op: => T): T

Tests permissions before applying operation.

Tests permissions before applying operation.

If all supplied permissions are granted, the operation is applied; otherwise, SecurityViolation is thrown.

Value parameters

op

operation

perms

permissions

Attributes

Returns

operation value

Throws
SecurityViolation

if all permissions are not granted

Note

Operation is authorized if perms is empty.

Inherited from:
SecurityContext
def any[T](one: Permission, more: Permission*)(op: => T): T

Tests permissions before applying operation.

Tests permissions before applying operation.

If any of supplied permissions is granted, the operation is applied; otherwise, SecurityViolation is thrown.

Value parameters

more

additional permissions

one

permission

op

operation

Attributes

Returns

operation value

Throws
SecurityViolation

if no permission is granted

Note

Operation is authorized if perms is empty.

Inherited from:
SecurityContext
def any[T](perms: Set[Permission])(op: => T): T

Tests permissions before applying operation.

Tests permissions before applying operation.

If any of supplied permissions is granted, the operation is applied; otherwise, SecurityViolation is thrown.

Value parameters

op

operation

perms

permissions

Attributes

Returns

operation value

Throws
SecurityViolation

if no permission is granted

Note

Operation is authorized if perms is empty.

Inherited from:
SecurityContext
def apply[T](perm: Permission)(op: => T): T

Tests permission before applying operation.

Tests permission before applying operation.

If supplied permission is granted, the operation is applied; otherwise, SecurityViolation is thrown.

Value parameters

op

operation

perm

permission

Attributes

Returns

operation value

Throws
SecurityViolation

if permission is not granted

Inherited from:
SecurityContext
def test(perm: Permission): Boolean

Tests whether supplied permission is granted.

Tests whether supplied permission is granted.

Value parameters

perm

permission

Attributes

Returns

true if permission is granted; otherwise, false

Inherited from:
SecurityContext
def testAll(one: Permission, more: Permission*): Boolean

Tests whether all supplied permissions are granted.

Tests whether all supplied permissions are granted.

Value parameters

more

additional permissions

one

permission

Attributes

Returns

true if all permissions are granted; otherwise, false

Note

Test succeeds if perms is empty.

Inherited from:
SecurityContext
def testAll(perms: Set[Permission]): Boolean

Tests whether all supplied permissions are granted.

Tests whether all supplied permissions are granted.

Value parameters

perms

permissions

Attributes

Returns

true if all permissions are granted; otherwise, false

Note

Test succeeds if perms is empty.

Inherited from:
SecurityContext
def testAny(one: Permission, more: Permission*): Boolean

Tests whether any of supplied permissions is granted.

Tests whether any of supplied permissions is granted.

Value parameters

more

additional permissions

one

permission

Attributes

Returns

true if any permission is granted; otherwise, false

Note

Test succeeds if perms is empty.

Inherited from:
SecurityContext
def testAny(perms: Set[Permission]): Boolean

Tests whether any of supplied permissions is granted.

Tests whether any of supplied permissions is granted.

Value parameters

perms

permissions

Attributes

Returns

true if any permission is granted; otherwise, false

Note

Test succeeds if perms is empty.

Inherited from:
SecurityContext