mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Using extendedCan for can*
This commit is contained in:
parent
5d76048275
commit
a307753886
@ -2576,6 +2576,10 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
||||
* @return boolean
|
||||
*/
|
||||
public function canView($member = null) {
|
||||
$extended = $this->extendedCan(__FUNCTION__, $member);
|
||||
if($extended !== null) {
|
||||
return $extended;
|
||||
}
|
||||
return Permission::check('ADMIN', 'any', $member);
|
||||
}
|
||||
|
||||
@ -2584,6 +2588,10 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
||||
* @return boolean
|
||||
*/
|
||||
public function canEdit($member = null) {
|
||||
$extended = $this->extendedCan(__FUNCTION__, $member);
|
||||
if($extended !== null) {
|
||||
return $extended;
|
||||
}
|
||||
return Permission::check('ADMIN', 'any', $member);
|
||||
}
|
||||
|
||||
@ -2592,6 +2600,10 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
||||
* @return boolean
|
||||
*/
|
||||
public function canDelete($member = null) {
|
||||
$extended = $this->extendedCan(__FUNCTION__, $member);
|
||||
if($extended !== null) {
|
||||
return $extended;
|
||||
}
|
||||
return Permission::check('ADMIN', 'any', $member);
|
||||
}
|
||||
|
||||
@ -2602,6 +2614,10 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
||||
* @return boolean
|
||||
*/
|
||||
public function canCreate($member = null) {
|
||||
$extended = $this->extendedCan(__FUNCTION__, $member);
|
||||
if($extended !== null) {
|
||||
return $extended;
|
||||
}
|
||||
return Permission::check('ADMIN', 'any', $member);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user