mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR Documentation
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@104795 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
36eb2c91ff
commit
eb178cc75e
@ -2265,6 +2265,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
||||
|
||||
/**
|
||||
* Returns true if the member is allowed to do the given action.
|
||||
* See {@link extendedCan()} for a more versatile tri-state permission control.
|
||||
*
|
||||
* @param string $perm The permission to be checked, such as 'View'.
|
||||
* @param Member $member The member whose permissions need checking. Defaults to the currently logged
|
||||
@ -2332,7 +2333,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
||||
|
||||
/**
|
||||
* Process tri-state responses from permission-alterting decorators. The decorators are
|
||||
* expected to return one of 3 values
|
||||
* expected to return one of three values:
|
||||
*
|
||||
* - false: Disallow this permission, regardless of what other decorators say
|
||||
* - true: Allow this permission, as long as no other decorators return false
|
||||
@ -2340,9 +2341,15 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
||||
*
|
||||
* This method itself returns a tri-state value, and is designed to be used like this:
|
||||
*
|
||||
* <code>
|
||||
* $extended = $this->extendedCan('canDoSomething', $member);
|
||||
* if($extended !== null) return $extended;
|
||||
* else return $normalValue;
|
||||
* </code>
|
||||
*
|
||||
* @param String $methodName Method on the same object, e.g. {@link canEdit()}
|
||||
* @param Member|int $member
|
||||
* @return boolean|null
|
||||
*/
|
||||
public function extendedCan($methodName, $member) {
|
||||
$results = $this->extend($methodName, $member);
|
||||
@ -2355,8 +2362,12 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper functon for extendedCan
|
||||
*
|
||||
* @param Mixed $value
|
||||
* @return boolean
|
||||
*/
|
||||
private function isNotNull($value) {
|
||||
return !is_null($value);
|
||||
|
Loading…
x
Reference in New Issue
Block a user