mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
API Support new DataObject::can() signature
This commit is contained in:
parent
5852cd56a5
commit
d22ad706a9
@ -760,9 +760,10 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
*
|
*
|
||||||
* @param string $perm The permission to be checked, such as 'View'
|
* @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 in user.
|
* @param Member $member The member whose permissions need checking. Defaults to the currently logged in user.
|
||||||
|
* @param array $context Context argument for canCreate()
|
||||||
* @return bool True if the the member is allowed to do the given action
|
* @return bool True if the the member is allowed to do the given action
|
||||||
*/
|
*/
|
||||||
public function can($perm, $member = null) {
|
public function can($perm, $member = null, $context = array()) {
|
||||||
if(!$member || !(is_a($member, 'Member')) || is_numeric($member)) {
|
if(!$member || !(is_a($member, 'Member')) || is_numeric($member)) {
|
||||||
$member = Member::currentUserID();
|
$member = Member::currentUserID();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user