StaticConstraintAnalyzer

be.objectify.deadbolt.scala.StaticConstraintAnalyzer
@Singleton
class StaticConstraintAnalyzer(patternCache: PatternCache)

Static constraint analysis.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def checkPatternEquality(maybeSubject: Option[Subject], maybePatternValue: Option[String]): Boolean

Check if any of the subject's permissions equals the supplied pattern value.

Check if any of the subject's permissions equals the supplied pattern value.

Value parameters

maybePatternValue

an option for the equality pattern

maybeSubject

an option for the subject

Attributes

Returns

true iff the subject has permissions and at least one equals the pattern value

def checkRegexPattern(maybeSubject: Option[Subject], maybePattern: Option[String]): Boolean

Check if any of the subject's permissions match the supplied regular expression.

Check if any of the subject's permissions match the supplied regular expression.

Value parameters

maybePattern

an option for the regular expression

maybeSubject

an option for the subject

Attributes

Returns

true iff the subject has permissions and at least one matches the regular expression

def getSubjectRoles(maybeSubject: Option[Subject]): Option[List[String]]

Convert the subject's roles to a list of role names.

Convert the subject's roles to a list of role names.

Value parameters

maybeSubject

an option for the subject

Attributes

Returns

None if the subject is None or the subject has no roles, otherwise Some list of strings in the same order as the roles

def hasAllRoles(maybeSubject: Option[Subject], requiredRoleNames: RoleGroup): Boolean

Check if the subject has several roles using AND.

Check if the subject has several roles using AND.

Value parameters

maybeSubject

an option for the subject

requiredRoleNames

all the roles the subject must hold

Attributes

Returns

true iff the subject has all roles

def hasRole(maybeSubject: Option[Subject], requiredRoleName: String): Boolean

Check if the subject has a single role.

Check if the subject has a single role.

Value parameters

maybeSubject

an option for the subject

requiredRoleName

the role name the subject is required to have

Attributes

Returns

true iff the subject has that role