Problems, need help? Have a tip or advice? Post it here.
13 posts Page 1 of 2
Hello!

Is it possible to create custom user groups in Couch?

The reason I ask is because there are going to be multiple users of a board accessing the site, and the person I am communicating with wants to limit viewing and editing of articles (inside the admin panel only of course) to each user.

For instance, if I have sections labelled "Hockey", "Swimming Pool", "Baseball", I want to make user groups to match the sections so that I can assign users to these groups and only they will be able to edit content, and if possible limit viewing of other sections in the admin panel (It's fine if they can view sections, as long as they can't edit or add).

How can I go about doing this, and what files do I edit?

Thanks much!
Hello proofinlife,

For now, the admin-panel remains accessible only to admins and super-admins.
And the one who is granted access to the panel gets full access. So, it is a all or nothing scenario, I am afraid.
This might be a good function to implement in a future update. Just in case anyone has users that they don't want editing certain sections. Thanks though, will have to figure something out
You can try Databound forms in the meanwhile to allow controlled access via front-end.
Okay, so I'm at the point where I want to create a little embedded edit page link on each page.

Like I said, I have to design it using some sort of "user groups" approach, so what I'm thinking I have to do is somehow fetch username's or userid's from the stored cookie information. I also need to make a login script that doesn't forward the user's to the CMS backend so they can't log in and edit whatever they please.

Like I said the reason I'm doing this is because there are multiple committees, with different members, from different communities. The client wants every section segregated from each other so, for instance, member from committee 'a' cannot edit content from committee b's section.

I'm taking a wild stab here that most, if not all of the work is going to have to be done using raw php code and mysql queries for the user authentication end of it (login script that points back to the site and not the Admin CP) and sets cookies the same way Couch would and also fetches UserID's from the database for use in my roughed-out User Groups approach, for which another cookie will be set called "usergroup" that is used for the page access level permissions.

Is there any functionality in couch that fetches the userid from the cookies to make the process a little simpler? If not, what sort of SQL query would you recommend I use?

Basically, I'm going to add a staff login form right on the website, which they'll fill in their user name and password that is used in couch. The form will point to a custom login page that sets the same cookies couch uses, as well as assigns a usergroup or usergroup_id that I will have userid's hard coded inside arrays. Once the usergroup cookie is set (as well as all cookies) it will redirect back to the main site, to which the user can navigate to the section that they are supposed to be editing and then use databound forms to edit the content, as you suggested.
Hi,

I wonder if you came across the 'Members module' here -
viewtopic.php?f=5&t=8063

It does almost exactly what you listed.

As for the 'groups', one simple way to get that functionality could be as follows -
since the members now are basically simple pages, you can create 'folders' to represent the groups. Assign members to respective folders and now you can place a check on templates to see if the visiting member belongs to a particular folder before granting access.

Does this help?
Please let me know.
KK wrote: Hi,

I wonder if you came across the 'Members module' here -
viewtopic.php?f=5&t=8063

It does almost exactly what you listed.

As for the 'groups', one simple way to get that functionality could be as follows -
since the members now are basically simple pages, you can create 'folders' to represent the groups. Assign members to respective folders and now you can place a check on templates to see if the visiting member belongs to a particular folder before granting access.

Does this help?
Please let me know.


Very nice, so the user login and stuff looks pretty straight forward.

Am I following that with the members module I can add a custom field like "Site_Section" and have a

Code: Select all
<cms:if site_section="Hockey">
Display page edit code
<else />
Print "You do not have access!!"
</cms:if>


code added?
As I said, members created by this module are nothing but our plain old cloned pages.
So everything you know about pages work the same here - including what you mentioned.
KK wrote: As I said, members created by this module are nothing but our plain old cloned pages.
So everything you know about pages work the same here - including what you mentioned.


So basically all I have to do is make corresponding pages under members that match username?

I remember reading in another thread that there might not be functionality to pull user information, I may be wrong though. Is there a couch command to drop the currently logged in user account or the cookie information to link the corresponding user to the template so it's actually checking "user credentials"?
make corresponding pages under members that match username?
No you did not get it - the pages *are* the member accounts.

When you create a member, you actually create a page where the name of the page becomes the member's name. The member can login using this name (cookie etc. get automatically set to this info).

Please give the members module a deeper look and this will become clear.
Trust me, it is easy.
13 posts Page 1 of 2