mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Ensure SiteConfig::canView
This commit is contained in:
parent
3df41e1176
commit
a84361e4e8
@ -239,6 +239,23 @@ class SiteConfig extends DataObject implements PermissionProvider, TemplateGloba
|
||||
return $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can a user view this SiteConfig instance?
|
||||
*
|
||||
* @param Member $member
|
||||
* @return boolean
|
||||
*/
|
||||
public function canView($member = null) {
|
||||
if(!$member) $member = Member::currentUserID();
|
||||
if($member && is_numeric($member)) $member = DataObject::get_by_id('Member', $member);
|
||||
|
||||
$extended = $this->extendedCan('canView', $member);
|
||||
if($extended !== null) return $extended;
|
||||
|
||||
// Assuming all that can edit this object can also view it
|
||||
return $this->canEdit($member);
|
||||
}
|
||||
|
||||
/**
|
||||
* Can a user view pages on this site? This method is only
|
||||
* called if a page is set to Inherit, but there is nothing
|
||||
|
Loading…
Reference in New Issue
Block a user