mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Using extendedCan for can*
This commit is contained in:
parent
755a95e3f7
commit
83726b21a2
@ -2581,6 +2581,10 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
|||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function canView($member = null) {
|
public function canView($member = null) {
|
||||||
|
$extended = $this->extendedCan(__FUNCTION__, $member);
|
||||||
|
if($extended !== null) {
|
||||||
|
return $extended;
|
||||||
|
}
|
||||||
return Permission::check('ADMIN', 'any', $member);
|
return Permission::check('ADMIN', 'any', $member);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2589,6 +2593,10 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
|||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function canEdit($member = null) {
|
public function canEdit($member = null) {
|
||||||
|
$extended = $this->extendedCan(__FUNCTION__, $member);
|
||||||
|
if($extended !== null) {
|
||||||
|
return $extended;
|
||||||
|
}
|
||||||
return Permission::check('ADMIN', 'any', $member);
|
return Permission::check('ADMIN', 'any', $member);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2597,6 +2605,10 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
|||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function canDelete($member = null) {
|
public function canDelete($member = null) {
|
||||||
|
$extended = $this->extendedCan(__FUNCTION__, $member);
|
||||||
|
if($extended !== null) {
|
||||||
|
return $extended;
|
||||||
|
}
|
||||||
return Permission::check('ADMIN', 'any', $member);
|
return Permission::check('ADMIN', 'any', $member);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2607,6 +2619,10 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
|||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function canCreate($member = null) {
|
public function canCreate($member = null) {
|
||||||
|
$extended = $this->extendedCan(__FUNCTION__, $member);
|
||||||
|
if($extended !== null) {
|
||||||
|
return $extended;
|
||||||
|
}
|
||||||
return Permission::check('ADMIN', 'any', $member);
|
return Permission::check('ADMIN', 'any', $member);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user