mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-09-05 09:11:28 +02:00
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@103384 467b73ca-7a2a-4603-9d3b-597d59a354a9
56 lines
1.4 KiB
PHP
56 lines
1.4 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Admin interface for Permission Roles.
|
|
*
|
|
* @package cms
|
|
* @subpackage security
|
|
*/
|
|
class PermissionRoleAdmin extends ModelAdmin {
|
|
static $managed_models = array(
|
|
'PermissionRole'
|
|
);
|
|
|
|
public static $collection_controller_class = "PermissionRoleAdmin_CollectionController";
|
|
public static $record_controller_class = "PermissionRoleAdmin_RecordController";
|
|
|
|
static $url_segment = 'roles';
|
|
static $menu_title = 'Roles';
|
|
}
|
|
|
|
/**
|
|
* Customized controller for hiding permissions on AddForm
|
|
*
|
|
* @package cms
|
|
* @subpackage security
|
|
*/
|
|
class PermissionRoleAdmin_CollectionController extends ModelAdmin_CollectionController {
|
|
public function AddForm() {
|
|
$form = parent::AddForm();
|
|
if ( $this->modelClass=='PermissionRole' ) {
|
|
$permissionField = $form->Fields()->dataFieldByName('Codes');
|
|
if($permissionField) $permissionField->setHiddenPermissions(SecurityAdmin::$hidden_permissions);
|
|
}
|
|
return $form;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Customized controller for hiding permissions on EditForm
|
|
*
|
|
* @package cms
|
|
* @subpackage security
|
|
*/
|
|
class PermissionRoleAdmin_RecordController extends ModelAdmin_RecordController {
|
|
public function EditForm() {
|
|
$form = parent::EditForm();
|
|
if ( $this->parentController->modelClass=='PermissionRole' ) {
|
|
$permissionField = $form->Fields()->dataFieldByName('Codes');
|
|
if($permissionField) $permissionField->setHiddenPermissions(SecurityAdmin::$hidden_permissions);
|
|
}
|
|
return $form;
|
|
}
|
|
}
|
|
|
|
?>
|