mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX: removing permissions before re-applying them (previously it just removed the components on the relation which resulted in permissions having GroupID set to 0)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@94810 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
cdada2784d
commit
fa3fe47284
@ -122,7 +122,13 @@ class PermissionCheckboxSetField extends CheckboxSetField {
|
||||
function saveInto(DataObject $record) {
|
||||
$fieldname = $this->name;
|
||||
$managedClass = $this->managedClass;
|
||||
$record->$fieldname()->removeAll();
|
||||
|
||||
// remove all permissions and re-add them afterwards
|
||||
$permissions = $record->$fieldname();
|
||||
foreach ( $permissions as $permission ) {
|
||||
$permission->delete();
|
||||
}
|
||||
|
||||
if($fieldname && $record && ($record->has_many($fieldname) || $record->many_many($fieldname))) {
|
||||
$idList = array();
|
||||
if($this->value) foreach($this->value as $id => $bool) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user