Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Member Group codes

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: 2805 Views
  • Nathan Cox
    Avatar
    Community Member
    99 Posts

    Member Group codes Link to this post

    Hi, I'm using 2.0.2b and I noticed that when I create new user groups, the group's 'code' is always set to 'new-group', no matter what the group's name is.

    Does this normally happen or have I broken something? I noticed Group::setCode() seems to do what we need, but it's not called anywhere.

  • Andy
    Avatar
    230 Posts

    Re: Member Group codes Link to this post

    Hmm this appears to be a bug. I think it acts like this so that when the a module like the forum makes a group called "forum-members", the user doesn't accidently change it. Maybe if a seperate field for forum code, that doesn't automatically change when the title is changed is a good idea.

  • Nathan Cox
    Avatar
    Community Member
    99 Posts

    Re: Member Group codes Link to this post

    What about some kind of flag that tells it whether it can change the code? Set something like EditCode = false (or LockCode = true, whichever feels right) in the module so the user can't change it.

  • dio5
    Avatar
    Community Member
    501 Posts

    Re: Member Group codes Link to this post

    Any changes on this?

    I came across the same problem, see thread:
    http://www.silverstripe.com/silverstripe-development/flat/5921

  • Jedateach
    Avatar
    Forum Moderator
    227 Posts

    Re: Member Group codes Link to this post

    Instead of group Codes, use Permissions. Group.Code is deprecated.

  • dio5
    Avatar
    Community Member
    501 Posts

    Re: Member Group codes Link to this post

    Ok, but what about groups that don't have any permissions?
    If you create a frontend usergroup you can't give it any permissions in the cms, so there's no permissions to be checked for.
    And it's not possible to set Permissions like 'ViewPage' or something in the security section, and having to add it manually to the db seems odd.

    The AddToGroupByName method seems very useful, if the 'code' field would follow the title field.

    2805 Views
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.