Jump to:

17452 Posts in 4473 Topics by 1971 members


SilverStripe Forums » Archive » Deleting security groups

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 808 Views
  • thejackel
    Community Member
    33 Posts

    Deleting security groups Link to this post

    The security section seems to be slightly sketchy when deleting groups.

    One problem I have noticed is when you select to delete a group what contains child groups, if you DON'T highlight each child group (select the checkbox so the group becomes a solid colour, rather than a light gray), the group will not be deleted from the database.

    I've modified the javascript slightly so when a parent group is selected, ALL children are now automatically highlighted and assigned a delete action.

    If anyone else has had this problem, feel free to use the code below as a workaround (its been tested for one branch but no more).

    1. Open cms\javascript\SecurityAdmin_left.js

    2. Go to the deletegroup object and insert the following lines below the if(sel && sel.className.indexOf('nodelete') == -1) { } block:

    // NEW: Added to highlight child groups automatically
    var children = sel.getElementsByTagName('li');
    for(var i=0; i<children.length; i++)
    var selIdx = $('sitetree').getIdxOf(children);
    deletegroup.selectedNodes[selIdx] = true;

    This will basically highlight the child groups and assign the delete group method so the groups are deleted properly.

    This issue also seems to affect users within the groups (if a group contains users, they are removed from the security section but still exist in the members table?!).

    If i determine a quick fix for this I'll post it up.

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.