mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR Formatting and documentation in Permission
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@86084 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
2b711fe45f
commit
e9df16ba5a
@ -85,19 +85,17 @@ class Permission extends DataObject {
|
||||
|
||||
|
||||
/**
|
||||
* Check that the current member has the given permission
|
||||
* Check that the current member has the given permission.
|
||||
*
|
||||
* @param string $code Code of the permission to check
|
||||
* @param string $arg Optional argument (e.g. a permissions for a specific
|
||||
* page)
|
||||
* @param string $code Code of the permission to check (case-sensitive)
|
||||
* @param string $arg Optional argument (e.g. a permissions for a specific page)
|
||||
* @param int|Member $member Optional member instance or ID. If set to NULL, the permssion
|
||||
* will be checked for the current user
|
||||
* @param bool $strict Use "strict" checking (which means a permission
|
||||
* will be granted if the key does not exist at all)?
|
||||
* @return int|bool The ID of the permission record if the permission
|
||||
* exists; FALSE otherwise. If "strict" checking is
|
||||
* disabled, TRUE will be returned if the permission does
|
||||
* not exist at all.
|
||||
* disabled, TRUE will be returned if the permission does not exist at all.
|
||||
*/
|
||||
public static function check($code, $arg = "any", $member = null, $strict = true) {
|
||||
if(!$member) {
|
||||
@ -125,18 +123,17 @@ class Permission extends DataObject {
|
||||
}
|
||||
|
||||
/**
|
||||
* Check that the given member has the given permission
|
||||
* Check that the given member has the given permission.
|
||||
*
|
||||
* @param int|Member memberID The ID of the member to check. Leave blank for the current member.
|
||||
* Alternatively you can use a member object.
|
||||
* @param string|array $code Code of the permission to check
|
||||
* @param string $arg Optional argument (e.g. a permissions for a specific
|
||||
* page)
|
||||
* @param string|array $code Code of the permission to check (case-sensitive)
|
||||
* @param string $arg Optional argument (e.g. a permissions for a specific page)
|
||||
* @param bool $strict Use "strict" checking (which means a permission
|
||||
* will be granted if the key does not exist at all)?
|
||||
* @return int|bool The ID of the permission record if the permission
|
||||
* exists; FALSE otherwise. If "strict" checking is
|
||||
* disabled, TRUE will be returned if the permission does
|
||||
* not exist at all.
|
||||
* disabled, TRUE will be returned if the permission does not exist at all.
|
||||
*/
|
||||
public static function checkMember($member, $code, $arg = "any", $strict = true) {
|
||||
if(!$member) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user