Nos\User\
Model_Role
¶Extend Nos\Orm\Model
.
Nos\User\Model_Role::$
users
¶Model_User
Nos\User\Model_Role::
checkPermission
($permission_name, $category_key = null, $allow_empty = false)¶Check whether a permissions exists with the given category.
Parameters: |
|
---|---|
Returns bool: |
|
Nos\User\Model_Role::
listPermissionCategories
($permission_name)¶List all the categories of a given permission name. Returns an array of string or false when the role has not access, or the permission name does not exists.
Parameters: |
|
---|---|
Returns: |
|
Nos\User\Model_Role::
checkPermissionOrEmpty
($permission_name, $category_key = null)¶Alias to Nos\User\Model_Role::checkPermission
with $allow_empty = true
.
Nos\User\Model_Role::
checkPermissionExists
($permission_name, $category_key = null, $allow_empty = false)¶Alias to Nos\User\Model_Role::checkPermission
.
Nos\User\Model_Role::
checkPermissionExistsOrEmpty
($permission_name, $category_key = null, $allow_empty = false)¶Alias to Nos\User\Model_Role::checkPermission
with $allow_empty = true
.
Nos\User\Model_Role::
checkPermissionIsAllowed
($permission_name, $allow_empty = false)¶Check against a binary permission (without categories).
Parameters: |
|
---|---|
Returns bool: |
|
Nos\User\Model_Role::
checkPermissionAtLeast
($permission_name, $threshold, $value_when_empty = 0)¶Check against a numeric / range permission.
You can use string
for the 2nd and 3rd parameters, they will be casted to (int)
. i.e. '2_write' === 2
.
Parameters: |
|
---|---|
Returns bool: |
|
Nos\User\Model_Role::
checkPermissionAtMost
($permission_name, $threshold, $value_when_empty = 0)¶Check against a numeric / range permission.
You can use string
for the 2nd and 3rd parameters, they will be casted to (int)
. i.e. '2_write' === 2
.
Parameters: |
|
---|---|
Returns bool: |
|
Nos\User\Model_Role::
getPermissionValue
($permission_name, $default = 0)¶Retrieve the value of a given permission.
Parameters: |
|
---|---|
Returns string: |