mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
FEATURE: Add a simple interface for administrating permission roles. (from r85297)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@89189 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
405fa48f84
commit
88d5843cab
@ -81,6 +81,18 @@ class Group extends DataObject {
|
|||||||
$this->ID
|
$this->ID
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|
||||||
|
new Tab(_t('SecurityAdmin.ROLES', 'Roles'),
|
||||||
|
new LiteralField(
|
||||||
|
"",
|
||||||
|
"<p>" .
|
||||||
|
_t('SecurityAdmin.ROLESDESCRIPTION',
|
||||||
|
"This section allows you to add roles to this group. Roles are logical groupings of permissions, which can be editied in the Roles tab"
|
||||||
|
) .
|
||||||
|
"</p>"
|
||||||
|
),
|
||||||
|
new CheckboxSetField('Roles', 'Roles', DataObject::get('PermissionRole'))
|
||||||
|
),
|
||||||
|
|
||||||
new Tab(_t('Security.IPADDRESSES', 'IP Addresses'),
|
new Tab(_t('Security.IPADDRESSES', 'IP Addresses'),
|
||||||
new LiteralField("", _t('SecurityAdmin.IPADDRESSESHELP',"<p>You can restrict this group to a particular
|
new LiteralField("", _t('SecurityAdmin.IPADDRESSESHELP',"<p>You can restrict this group to a particular
|
||||||
|
@ -18,4 +18,30 @@ class PermissionRole extends DataObject {
|
|||||||
static $belongs_many_many = array(
|
static $belongs_many_many = array(
|
||||||
"Groups" => "Group",
|
"Groups" => "Group",
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
static $default_sort = 'Title';
|
||||||
|
|
||||||
|
function getCMSFields() {
|
||||||
|
$fields = parent::getCMSFields();
|
||||||
|
|
||||||
|
$fields->removeFieldFromTab('Root', 'Codes');
|
||||||
|
$fields->removeFieldFromTab('Root', 'Groups');
|
||||||
|
|
||||||
|
$fields->addFieldToTab('Root.Main', new TableField(
|
||||||
|
"Codes",
|
||||||
|
"PermissionRoleCode",
|
||||||
|
array(
|
||||||
|
"Code" => _t('SecurityAdmin.CODE', 'Code'),
|
||||||
|
"Arg" => _t('SecurityAdmin.OPTIONALID', 'Optional ID'),
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
"Code" => "PermissionDropdownField",
|
||||||
|
"Arg" => "TextField",
|
||||||
|
),
|
||||||
|
"RoleID",
|
||||||
|
$this->ID
|
||||||
|
));
|
||||||
|
|
||||||
|
return $fields;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user