MINOR added a permission to manage who can edit the subsite a group is associated with (from r88849)

This commit is contained in:
Tom Rix 2010-03-01 21:26:30 +00:00
parent ea21e6ff35
commit 3dc406dcf0

View File

@ -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'
);
}
} }
?> ?>