Support for new DataObject->can() signature

Cherry pick from https://github.com/silverstripe/silverstripe-cms/pull/1435
in order to get CMS loading again.
This commit is contained in:
Ingo Schommer 2016-04-05 08:01:40 +12:00
parent 5852cd56a5
commit 5a7b7084ff

View File

@ -762,7 +762,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
* @param Member $member The member whose permissions need checking. Defaults to the currently logged in user.
* @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)) {
$member = Member::currentUserID();
}