mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
MINOR added a permission to manage who can edit the subsite a group is associated with (from r88849)
This commit is contained in:
parent
ea21e6ff35
commit
3dc406dcf0
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @package subsites
|
* @package subsites
|
||||||
*/
|
*/
|
||||||
class GroupSubsites extends DataObjectDecorator {
|
class GroupSubsites extends DataObjectDecorator implements PermissionProvider {
|
||||||
|
|
||||||
function extraStatics() {
|
function extraStatics() {
|
||||||
if(!method_exists('DataObjectDecorator', 'load_extra_statics')) {
|
if(!method_exists('DataObjectDecorator', 'load_extra_statics')) {
|
||||||
@ -19,6 +19,8 @@ class GroupSubsites extends DataObjectDecorator {
|
|||||||
|
|
||||||
function updateCMSFields(&$fields) {
|
function updateCMSFields(&$fields) {
|
||||||
|
|
||||||
|
if (!Permission::check('ADMIN') && !Permission::check('SECURITY_SUBSITE_GROUP')) return;
|
||||||
|
|
||||||
if( $this->owner->SubsiteID == 0 || $this->owner->canEdit() ){
|
if( $this->owner->SubsiteID == 0 || $this->owner->canEdit() ){
|
||||||
$subsites = DataObject::get('Subsite');
|
$subsites = DataObject::get('Subsite');
|
||||||
if ( $subsites && $subsites->exists() ) {
|
if ( $subsites && $subsites->exists() ) {
|
||||||
@ -134,6 +136,12 @@ class GroupSubsites extends DataObjectDecorator {
|
|||||||
return $group;
|
return $group;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function providePermissions() {
|
||||||
|
return array(
|
||||||
|
'SECURITY_SUBSITE_GROUP' => 'Edit the subsite a group can access'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
Loading…
Reference in New Issue
Block a user