From 3dc406dcf0451a4e42b039ea2486b5ebf5e48153 Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Mon, 1 Mar 2010 21:26:30 +0000 Subject: [PATCH] MINOR added a permission to manage who can edit the subsite a group is associated with (from r88849) --- code/GroupSubsites.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/code/GroupSubsites.php b/code/GroupSubsites.php index c337455..9dd6e85 100644 --- a/code/GroupSubsites.php +++ b/code/GroupSubsites.php @@ -4,7 +4,7 @@ * * @package subsites */ -class GroupSubsites extends DataObjectDecorator { +class GroupSubsites extends DataObjectDecorator implements PermissionProvider { function extraStatics() { if(!method_exists('DataObjectDecorator', 'load_extra_statics')) { @@ -19,6 +19,8 @@ class GroupSubsites extends DataObjectDecorator { function updateCMSFields(&$fields) { + if (!Permission::check('ADMIN') && !Permission::check('SECURITY_SUBSITE_GROUP')) return; + if( $this->owner->SubsiteID == 0 || $this->owner->canEdit() ){ $subsites = DataObject::get('Subsite'); if ( $subsites && $subsites->exists() ) { @@ -133,6 +135,12 @@ class GroupSubsites extends DataObjectDecorator { return $group; } + + function providePermissions() { + return array( + 'SECURITY_SUBSITE_GROUP' => 'Edit the subsite a group can access' + ); + } }