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.

Archive /

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

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

Member Group codes


Reply


6 Posts   2869 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
Andy

230 Posts

18 July 2007 at 9:43am

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.

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:
[url]http://www.silverstripe.com/silverstripe-development/flat/5921[/url]

Avatar
Jedateach

Forum Moderator, 232 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.