I've enabled the user profile core-optional module so I see the options for creating new fields for users, including the option for a static select list. What I need though, is to get that select list to populate dynamically from a list that the site administrators can set up. Specifically, they need to be able to assign the new user to a "group" field, which will then limit access to only that group's projects.
So, I suppose I'm after two things: 1) the best way to create a new custom field called "group" to allow the admins to create and modify groups and; 2) how to get those dynamic options to show up as a drop-down select list when creating a new user.
Thanks to anyone who can point me in the right direction!
Comments
_
Normally this is done with the http://drupal.org/project/og module.
Ahh, I see -- I haven't used
Ahh, I see -- I haven't used that module before. I've got it installed and set up my content types and I've set it up so that only admins can add users to groups -- but I'm not seeing where to do that. How can I add a user to a group?
_
It's at og/users/{gid}/add_user where {gid} = the group id of the group. It's also available via the "members" link on the group details block (which needs to be enabled at admin/build/block if you haven't done so already).
Thanks!
Excellent, that did it -- thanks!
By the way, you don't happen
By the way, you don't happen to know if there's any way to get this user-groups administration to be displayed using the admin theme, do you? Everything else on the site can be done from within the admin theme and it's a bit odd to have the users drop back to manage this one feature.
_
I would think the reason it works this way is because there are usually group admins that are not site admins so it would be odd for them to be jolted with an admin theme for that one page.
In any case, you might be able to get this working the way you want with the http://drupal.org/project/themekey or http://drupal.org/project/sections modules.
Ok, I'll look into those,
Ok, I'll look into those, thank you. I'm afraid though, that I'm creating something far more complicated than is necessary. What I'd like is some way to modify the select list options under the user profile module to have it look to a view or somehow populate with content from an established content type. While I like the functionality of the OG module, it's a lot of extraneous stuff for what seems to be a pretty simple need, in my case.
Ideally, I'd like to present the site admins with an extra drop-down option when they create a user that simply says "group" or something of the sort. Then, access can be restricted using views and their group setting.
Is there not anything that would allow this?
Again -- I appreciate your help and am glad that you pointed out the OG module to me as I'm sure I'll use it in future projects -- but in this case, it just seems like extreme overkill.
_
No problem-- another way to approach this would be with taxonomy. See Controlling Access to Content by Configuring Groups as Roles - it's for d5, but the concepts are the same.
Interesting...
That seems to be a lot more like what I had in mind. Unfortunately I haven't built a Drupal site yet that makes any use of taxonomy so it seems like now is as good a time as any to learn about it. Thanks for that link, I appreciate it!