Hello, Jeff,

I've been playing around with the simple_access module, and I love how it works -- you did a great job hitting your goal of simplifying access control w/in Drupal.

Really, I don't know if this is most accurately a bug report, a feature request, or me configuring things incorrectly...

It appears to me that a user needs to have "administer nodes" permissions in order to see the options for posting into simple access groups -- if this is correct, a user who has the ability to post into specific groups also has the ability to edit all public, non-group-specific content on the site.

Is this the case, or am I missing something? Given the thoroughness of how this module handles access control, I feel like this is in all likelihood a configuration error on my part, but I played around with different levels of access for different roles and different groups in a pretty systematic way for a few hours, and I couldn't sort it out.

Thanks for this. This is a great module.

Comments

Geary’s picture

It appears to me that a user needs to have "administer nodes" permissions in order to see the options for posting into simple access groups...

That's my impression too. When I log in as a user without "administer nodes" permission, the various blog/page/etc. edit forms do not have the access groups listed. Only admin users have these listed.

Taking Jeff's example,

Access groups are based on roles. So for example, my site has roles entitled "Coach Level 1", "Coach Level 2", and "Coach Level 3". I can create an access group called "Coaches" and assign all of these roles to it. Then when I assign a node to be viewable only by "Coaches", only users who are a member of these roles will be able to view.

What I'm looking for is a way for the coaches (who are not admins) to post content to their own private forums and categories. I don't see a way to do this with the Simple Access module. (Please correct me if I'm wrong.)

I did find another module that lets me do this, the Taxonomy Access module. That module gives you a big admin panel for each user role, where you can select the forums and categories that the role can access. So the coaches in Jeff's example would be able to post to their own private forums and categories without being admins. I would have to configure each of the three Coach Level roles separately--there's no concept of an access group, but that's not a problem for me.

Taxonomy Access is a bit more work than usual to install because it requires a patch to taxonomy.module, but it seems to work well.

Gabriel R.’s picture

Yes, I've also noted this. It defeats the purpose of the access limitations, doesn't it?

dublin drupaller’s picture

This is a superb module but I too am looking for the ability of users to specify who can view their own blogs/nodes.

I have had a quick look at the code and it seems to be hooked into the ADMINISTER NODES permissions..i.e. if the user role has Administer Node permission they will see the Simple Access form.

I tried patching it with a new permission called 'set access per node', but, it wouldn't work. I think it needs a deeper patch than that, unless I'm missing something very simple.

Anyone else out there know of a way to make the simple access form available to non ADMIN users?

Dub

jjeff’s picture

Category: bug » feature

Hmmm...

This is an interesting idea -- let's call it a feature request.

I followed Drupal's conventions for modules like comments.module which put their stuff in the 'form admin' case of the nodeapi. These things only show up for users with administer nodes permissions and they show up grouped relatively nicely at the top of the page.

What I'm looking for is a way for the coaches (who are not admins) to post content to their own private forums and categories. I don't see a way to do this with the Simple Access module. (Please correct me if I'm wrong.)

I totally get this. Thanks for the example. However, help me work out the logic here: What if a user posts something to an access group that they are not a part of? They could inadvertently create a node that they could not see! This problem is solved for users with 'administer nodes' privileges because they can see/edit/delete all nodes. I'm not saying that this way is beter so much as it just circumvents that problem.

And then there's the (admitedly selfish, idealistic, and a little bit complainy) issue of having the simple-access checkbox groups show up in the flow of the page. I really like them at the top. Happily, there is some work being done on Drupal's form system, but right now form elements can only be added at the beginning (form pre) or end (form post) of the node form -- and elements are added alphabetically by module. If I renamed the module "_Simple_Access" or "A_Simple_Access", then I could get the checkboxes at the top of the page, but they'd still be after the title field. Likewise I could go with "Zimple_Access" to try to get to the end of the form. :-) Okay I'll hold out for the revamped form system.

It appears to me that a user needs to have "administer nodes" permissions in order to see the options for posting into simple access groups -- if this is correct, a user who has the ability to post into specific groups also has the ability to edit all public, non-group-specific content on the site.

Also note that this module was not originally designed for users to post private group messages. It was designed for administrators to control node access, not users at large. You should check out Organic Groups module for that.

However, I think that I could probably pretty easily create an access permission for "control access" and users assigned to roles with this permission checked would be able to assign nodes to any access group of which they are a member. For users with "administer nodes" permission, the checkboxes would appear at the top of the form (where they are now) and they would be able to assign nodes to any access group.

Sound like a good solution?

-Jeff

bonobo’s picture

RE

However, I think that I could probably pretty easily create an access permission for "control access" and users assigned to roles with this permission checked would be able to assign nodes to any access group of which they are a member. For users with "administer nodes" permission, the checkboxes would appear at the top of the form (where they are now) and they would be able to assign nodes to any access group.

This sounds like a GREAT solution. One of the things that distinguishes simple_access from og is the UI -- simple access retains the basic organization of the Drupal site, where og changes the look/feel of the site a bit -- this is particularly true for a person on an og site who is a member of two groups.

Thank you for your work on this module. It does a great job providing another method of access control (along with tax access and og) on Drupal sites.

Cheers,

bonobo

Gabriel R.’s picture

jjeff, this sounds terrific. In fact, I believe that once this fixed and the "access groups of users not of roles" changed, Simply Access would be really worth including in core.

Thanks for your understanding!

Gabriel R.’s picture

Hello Jeff,

did you have a chance to do the changes you've proposed?

Need help?

Thanks.

jjeff’s picture

I've just committed an update of Simple Access for HEAD (4.7) that

a) updates the module to work with the new formapi in 4.7.
- and -
b) adds the feature requested in this thread. There is now a permission entitled "assign access to nodes". This can be enabled for non-administrators and they will be shown just the access groups to which they belong.

-Jeff

jjeff’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)
dww’s picture

Version: » 4.6.x-1.x-dev
Status: Closed (fixed) » Active

sorry to re-open a closed issue, but i'd love to see this working in the 4.6 simple_access module. i, too, think simple_access is great, but i think content authors (not just node admins) need to be able to control who can see the specific content they create.

sadly, your giant commit (revision 1.16) did two changes at once, which makes it impossible for me to *just* apply the diff for this feature without also getting all the upgrade to the forms API, too. not having carefully reviewed the over 400 line diff, this might be wrong, but on the surface, it appears that the feature discussed here didn't really depend on the 4.7 forms API, and this change could have been made to 4.6 (as was originally discussed in this thread). if i have to, i'll reimplement this myself in my local cvs repository for my 4.6 site, but if there's any interest in this in 4.6 (which it seems there was a lot of), it'd be nice to have this done "officially" to 4.6. it actually seems like a pretty trivial diff (maybe 30 lines or so) would do the trick.

jeff, how easy would it be for you (as the author of revision 1.16) to just apply this feature without the forms API stuff to the 4.6 version of simple access?

if it'd take you more than 15 minutes and you don't have time to spare, if i did the work to create a patch against 4.6, would you apply it? if not, i'll just stick with my existing 2 line hack change to my own copy of simple_access which basically does what I need (if you can edit a node, you can change the simple access settings):

--- simple_access.module    20 Feb 2006 07:37:43 -0000  1.1.1.1
+++ simple_access.module    26 Feb 2006 08:59:21 -0000
@@ -96,7 +96,7 @@ function simple_access_node_grants($acco
  */
 function simple_access_nodeapi(&$node, $op, $arg = 0) {
   switch ($op) {
-    case 'form admin':
+    case 'form post':
       // We present the selection for who can view the node in the administrative
       // block, so users with the "administer nodes" permission can view and edit
       // the settings.
@@ -178,7 +178,7 @@ function simple_access_nodeapi(&$node, $
     case 'update':
       // if user doesn't have administer nodes permission, then the simple_access
       // boxes weren't on the page... so don't parse what ain't there! (see 'else')
-      if (user_access('administer nodes')) {
+      if (user_access('administer nodes') || 1) {
         // Clear out any existing grants for the node. Don't worry, we'll set them again.
         db_query('DELETE FROM {node_access} WHERE nid = %d AND realm = \'simple_access\'', $node->nid);
         $views = FALSE;

it's a total hack, but it works for me. obviously, if i was going to submit a patch for this, i'd do a better job, add the new access control permission, clean up comments that weren't true anymore, etc...

please let me know what you think.

thanks for the great module!
-derek

Zed Pobre’s picture

I'd like to second DWW's request. I'm now using his hack as well.

kae’s picture

third

bonobo’s picture

Assigned: Unassigned » bonobo
Status: Active » Closed (fixed)

Given the age of this issue, and the fact that it's 4.6 specific, I'm switching the status of this to closed.

dww’s picture

Status: Closed (fixed) » Closed (won't fix)

if it's not done, "won't fix" is more appropriate than "closed".