The attached patch modifies the Forum Overview form (/admin/structure/forum) by adding an extra column about rights. It is not intended as a complete replacement for the granular settings of rights granted in the edit section, more like a quick indication of the highest privilege of a given user role. It provides the admin with a simple overview of forums open or closed to various users as well as some indication of moderator and admin rights.

Icons come from www.iconfinder.com. If this addition happens to be accepted into the module, those might need to be replaced.

Comments

salvis’s picture

Please post a screenshot of what this would look like.

djg_tram’s picture

StatusFileSize
new26.68 KB

With the caveat that it's not English...

salvis’s picture

Are you enumerating all roles? That doesn't scale well...

One of my sites has over 20 roles, and it's a small site with less than 200 users.

djg_tram’s picture

Yes, that's true. An alternative would be to put them into a list, each role into its own line. Easier in some respects but could make the table rather long. Also, in a settings dialog, you could decide which roles to display, not all of them might be really interesting here (eg. you can leave out admins if they always have every right, anyway). I also thought of abbreviating the role names forcibly. At any rate, it's a suggestion that works well on one or two sites I currently use it on...

salvis’s picture

Status: Active » Needs review

No, if this wraps to more than one line, then the "overview" in "forum overview" gets lost.

I see its usefulness on sites with very few roles, but it's not of sufficiently general interest to go into Forum Access directly. However, if you manage to cast it into a self-contained module then it could go in as an optional add-on.

Let's see what the testbot says about your patch; I'm sure it would prefer a single-file patch, just like the humans...

Status: Needs review » Needs work

The last submitted patch, forum_access.module.patch, failed testing.

djg_tram’s picture

Yes, you were right. But with icons and stuff, I'll roll it into a separate module and let's see that. Actually, this also would take care of its settings possibilities, to specify which role, to decide in which format...

djg_tram’s picture

StatusFileSize
new6.89 KB

Well, how's about this one?

Has its setting on the Settings page of the forum, two styles now and you can select the roles you're interested in.

salvis’s picture

Please don't zip your code — no one will look at it if you hide it inside an archive.

See http://drupal.org/patch/create and make sure you have Unix-style line endings.

Set the Status to 'needs review' to activate the testbot.

djg_tram’s picture

But this is not a patch but a complete, standalone module. I didn't expect the testbot to test it as if it were a patch...

salvis’s picture

Ah, sorry, I don't see what's inside.

Even if it's a complete module, you can still put it inside the forum_access directory and create a single-file patch (including the binary icon files!) from it. The testbot will do some useful preliminary testing, and the patch format will let us look at your code in the browser, comment on it using Dreditor, monitor its progress, install and uninstall it quickly, and eventually commit it as a patch.

djg_tram’s picture

Status: Needs work » Needs review
StatusFileSize
new15.47 KB

Let's see. Created as per the instructions I could locate here on Drupal.org. SmartGit is not that smart, actually... :-))

salvis’s picture

Ah, passed perfectly and applies nicely. I'll have some minor comments later, but it's looking pretty good.

@djg_tram: What are your intentions for this module? Would you like to release it as a module of its own or contribute it as an add-on to the Forum Access project?

Anyone else care to take a look? Please comment!

djg_tram’s picture

To contribute, for sure. It's a small one to start with, and it's linked so strongly to FA that there would be little point in making it standalone.

As far as possible issues are concerned, I really hate the idea of duplicating complete functions from core. But with draggable tables, it still seems the only way to go.

gbyte’s picture

Issue summary: View changes
StatusFileSize
new9.96 KB

Was getting Notice: Undefined index: tid in forum_access_show_rights_form_forum_overview_alter()
Changed
$tid = $form[$key]['tid']['#value']; on line 39 to
$tid = $form[$key]['#term']['tid'];, now the $tid is always available. See attached patch.

Works very well for me now, would love to see this commited. Doesn't have to be a module within the forum access suite - I think it can be integrated straight into the main module, as this is only invoked on one form and doesn't eat resources otherwise. Thanks djg_tram!

Status: Needs review » Needs work

The last submitted patch, 15: forum_access-access-rights-overview-1347646-15.patch, failed testing.

gbyte’s picture

Status: Needs work » Needs review

Not sure why it failed, applies cleanly here. Maybe because of the image files?

salvis’s picture

Status: Needs review » Closed (won't fix)
diff --git a/forum_access_show_rights/icons/create.png b/forum_access_show_rights/icons/create.png
new file mode 100644
index 0000000..375f917
Binary files /dev/null and b/forum_access_show_rights/icons/create.png differ

This doesn't make sense. If you're creating a new file, it cannot just "differ". In cases like these you should create (and post!) an inter_diff.txt that shows the changes between the two patches, then you would have seen the problem immediately. But...

AFAICS this only works if you have very few roles, and you are the second person (besides the OP) showing interest in this functionality in three years. This means it's not of general interest, and committing it would add a maintenance burden with very little benefit. Sorry...