lucee.Componentmodels.delegates.Authorizable
Copyright since 2016 by Ortus Solutions, Corp www.ortussolutions.com --- This delegate allows for objects to verify permissions and roles on the $parent This delegate expects the following functions to be exposed in the $parent and they must return an array of values - getPermissions() - getRoles() - getId()
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
any
|
cbSecurity
|
true
|
false
|
Method Summary | |
---|---|
private array
|
arrayWrap(any items)
convert one or a list of permissions to an array, if it's an array we don't touch it. |
boolean
|
hasAll(any permissions)
Verify that ALL the permissions passed must exist within the authenticated user. |
boolean
|
hasNone(any permissions)
Verify that NONE of the permissions passed must exist within the authenticated user. |
boolean
|
hasPermission(any permission)
Verify if the parent has one or more of the passed in permissions. |
boolean
|
hasRole(any role)
Verify if the parent has one or more of the passed in roles. |
any
|
isLoggedIn()
Verify if the current user is logged in or not. |
boolean
|
sameUser(any user)
Verify that the passed in user object must be the same as the authenticated user. |
Methods inherited from class lucee.Component |
---|
None |
Property Detail |
---|
access
- publicrequired
- falsereturntype
- anyinject
- cbSecurity@cbSecurityserializable
- trueMethod Detail |
---|
convert one or a list of permissions to an array, if it's an array we don't touch it
items
- One, a list or an arrayVerify that ALL the permissions passed must exist within the authenticated user
permissions
- One, a list or an array of permissionsVerify that NONE of the permissions passed must exist within the authenticated user
permissions
- One, a list or an array of permissionsVerify if the parent has one or more of the passed in permissions
permission
- One or a list of permissions to check for accessVerify if the parent has one or more of the passed in roles
role
- One or a list of roles to check for accessVerify if the current user is logged in or not.
Verify that the passed in user object must be the same as the authenticated user Equality is done by evaluating the `getid()` method on both objects.
user
- The user to test for equality