Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

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

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

Member Group codes


Go to End


5 Posts   3297 Views

Avatar
Nathan Cox

Community Member, 99 Posts

17 July 2007 at 11:26am

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.

Avatar
Nathan Cox

Community Member, 99 Posts

18 July 2007 at 9:51am

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.

Avatar
dio5

Community Member, 501 Posts

27 September 2007 at 12:58am

Any changes on this?

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

Avatar
Jedateach

Forum Moderator, 238 Posts

29 October 2007 at 4:14pm

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

Avatar
dio5

Community Member, 501 Posts

29 October 2007 at 9:58pm

Edited: 29/10/2007 10:45pm

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.