Forum OpenACS Q&A: Group creation

Collapse
Posted by Jeff Rogers on
I'm trying to create a separate user group 'Power Users' to assign different permissions to, but I get an error when trying to create the group.

From the "Group types admin" page, I select "add a new group of this type", enter the group name, hit Ok and get a 404 error (or equivalent server error, depending on which version of aolserver I'm running) going to the page /admin/groups/%2fadmin%2fgroup-types%2fone%3fgroup_type%3duser_group. It looks kind of like it's trying to redirect the result page back to the group type page but the redirect is encoded incorrectly.

The group appears to have been created when I go back to the group types page, but with the error page I'm not sure if it was created correctly.

Collapse
2: Re: Group creation (response to 1)
Posted by Dave Bauer on
I think you are correct. Can you track down what page is generating that URL?

It looks like its going to /admin/groups/admin/group/-types/one which probably is not correct. Some of the slashes are URLencoded which is defnitely wrong. I suspect somehwere a return_url query parameter got messed up.

Note those group admin pages are rarely/never used and most groups are created programatically. It should do what you want if you create it through the web UI, but if its a commmon thing you'll need to do, you might want to look into a way to automate it with a subsite or package instantiation callback.

Collapse
3: Re: Group creation (response to 1)
Posted by Torben Brosten on
Jeff Rogers,

If you need immediate group handling, an alternate way is to create a subsite for the group, and then manage the groups via the web ui group-subsite/members

You can then give permission to the group to access another subsite etc.

cheers,

Torben

Collapse
4: Re: Group creation (response to 2)
Posted by Jeff Rogers on
Looks like it's /admin/groups/new that's generating the redirect.

Probably won't be very common - this is a personal project I'm working on and it's a long way away from doing anything particularly notable yet - but I am a strong advocate for having even the little things work correctly :)

Collapse
5: Re: Group creation (response to 3)
Posted by Jeff Rogers on
No immediate need right now, but thanks for the tip.

But wouldn't creating it as a subsite mean that the permissions would be at the granularity of the whole subsite - a particular set of pages and/or url heirarchy, rather than particular components or actions? The particular use case I was envisioning was setting up particular people to be administrators for different parts of the site (not site-wide admins) - e.g., one person is the calendar admin, someone else is the boards admin - but all part of one site. Maybe I need to read through the subsite docs a little more.

Collapse
6: Re: Group creation (response to 1)
Posted by Dave Bauer on
If you want admins at the package_id level, look at application groups, which are scoped to a package_id.

You'll still need to grant/manage permissions and members manually. It's something that probably should be a feature but very rarely has anyone actually needed more specific than subsite level admin permissions.

Collapse
7: Re: Group creation (response to 1)
Posted by Torben Brosten on
Jeff,

You can apply permissions of members of a subsite to an object, such as another subsite.

Using the subsite-group/members UI

has been quite helpful, because it allows you to delegate management of the membership to other members, or automatic per subsite join/membership attributes (open/closed) etc.

cheers,

Torben

Collapse
8: Re: Group creation (response to 4)
Posted by Jeff Rogers on
Dug in a little deeper, it looks like the problem is in acs-subsite/www/admin/group-types/one.tcl. It sets up return urls like so:


set return_url_enc [ad_urlencode [ad_conn url]?[ad_conn query]]
....
set add_group_url [export_vars -url -base "../parties/new" {{party_type $group_type} {add_with_rel_type composition_rel} {return_url $return_url_enc}}]

so the value gets encoded twice. I think it should be just

set return_url [ad_conn url]?[ad_conn query]
....
set add_group_url [export_vars -url -base "../parties/new" {{party_type $group_type} {add_with_rel_type composition_rel} return_url}]

Collapse
9: Re: Group creation (response to 1)
Posted by Dave Bauer on
You can call

set return_url [ad_return_url] to simplify further, but your solution looks correct.