Closed (fixed)
Project:
Workbench Access
Version:
7.x-1.0-beta5
Component:
User interface
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
5 Mar 2011 at 12:00 UTC
Updated:
3 Jan 2014 at 02:58 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
agentrickardNo configuration yet (though it's in the plan). If you are comfortable with writing code, you can do this now:
From the api file:
Currently, the permissions for a user pass the $id permissions as an array with one entry 'all'. You can alter this behavior using the above function.
Then in the actual access check, we run this:
So if you had a conditional statement, you could write something like so:
This code, for instance, restricts editorial access according to the core 'edit any TYPE content' permission by section and should just work if you put it in a custom.module file.
If you aren't comfortable writing code, what I really need is a good UI pattern for setting these permissions. Should they go on the Permissions page? The Content Type configuration page? A custom Workbench Access settings page?
Ideas welcome.
Comment #2
simon georges commentedWow, what a complete answer ! Thanks a lot (I'm indeed ok with writing code).
Regarding the UI pattern, I was first in favor of a custom Workbench Access page, to allow quick configuration, but then I thought than the more content types you have, the more this page would be a bad idea. What's more, I think there's only a few content types that would be concerned by workbench access (although the main ones (pages, articles)). So, by starting with a settings on each content type page, unchecked by default, there would only be some clicks to have it working.
I see that Workbench moderation already has a setting in the content type page, I propose to do the same (like the Simplenews example in the attached screenshot), with just a "use Workbench Access for this content type" checkbox.
I'll try to work on that as I'm sure I'll need it on the projects I will work on in the future, but I'm not expecting to do Drupal 7 work before one or two months. If I'm faster than you anyway, I'll post it there.
Again, thanks for all the help.
Comment #3
agentrickardA patch to the main module is perfectly fine, btw...
Comment #4
agentrickardI'd really like some guidance from the UX team on this, actually.
Comment #5
Jean Gionet commentedwould love to see this feature eventually implemented !!
+sub
Comment #6
agentrickardAny ideas on how the UI should be formatted?
Comment #7
travis-cunningham commentedI agree with Simon Georges in #2. A simple use case would be excluding all Webforms from Workbench Access.
Having a single location to include/exclude a content type in the access tree like this would be ideal.
Comment #8
agentrickardPersonally, I really hate the "let's spread the configuration around to each content type config page" approach. I suppose we should do that and have a dashboard/overview screen that compiles all the settings as well.
Comment #9
gaele commentedThanks agentrickard for the extensive documentation.
+1 to #8
Should this overview screen be a generic function, so other module's settings could use it as well?
Also, I like #2: "So, by starting with a settings on each content type page, unchecked by default, there would only be some clicks to have it working." This would mean enabling the module would not have the effect of immediately blocking all content editing access.
Comment #10
craigktreasure commentedI am really looking forward to this feature. I like the idea of configuring this on the content type configuration page and agree with gaele.
Comment #11
akalata commentedSub, I hope to be able to contribute some UI/UX work/recos here.
Comment #12
agentrickardI think this one's pretty straightforward. It's #1155692: Allow per-section CRUD permissions that needs serious UI / UX design.
Comment #13
agentrickardPretty simple patch. Adds an option to the content type edit form and to Workbench Access configuration.
Any thoughts about the use of the fieldset? Should it not be collapsed?
Comment #14
agentrickardScreenshots of the form elements.
Comment #15
agentrickardRevised to use 'enforce' consistently on the UI.
Comment #16
agentrickardNow with a shiny new test.
Comment #17
stevectorAfter I applied this patch I unchecked the article content type. I then went to node/add/article and the Workbench Access select list appeared in the form. I don't think that's the intended behavior.
Also existing nodes article nodes reported in the WB message block the sections to which they had previously been assigned. While I do not think nodes should be removed from their sections on a database level, I think functions that would act on that information can check if the content type is still one on which Workbench Access acts.
Comment #18
agentrickardRevised patch.
Comment #19
agentrickardNeed to reverse the order of IF statements in the block.
Comment #20
stevectorI think the messages from Workbench Access should be suppressed when on a content type not controlled by Workbench Access.
Comment #21
agentrickardIn the newest patch, they should say "[Content type name] pages are not under access control".
That might be over-communicating, but it seems important.
Another question: How does this affect the dashboard Views?
Comment #22
agentrickardMore TODOs:
1. Implement hook_node_types_update().
2. Implement hook_node_types_delete().
3. Hide the field widget on Content Type manage fields screens if disabled for that content type.
Comment #23
agentrickardScratch items #1 and #2. They aren't needed. Node module handles that.
/me notes that @davereid was actually wrong about something....
Comment #24
agentrickardProper hiding of the field widget.
Comment #25
agentrickardAnd a patch that removes restricted node types from Views and other elements.
Bumping to major, since this is a release blocker.
Comment #26
stevectorI think there is a problem with the query method in workbench_access_handler_filter_access.inc
I have three content types on my test site: article, page and news. Workbench Access is configured to ignore article nodes.
Here is a query that Views produces when using this filter.
This query produces no results even though there are page nodes in the appropriate WB Accesss taxonomy. It looks like the problem is that second where clause. If I comment out this line:
$this->query->add_where(0, "$node_table.type", $allowed, 'IN');Then I do get results. However, I also get results of article nodes that were assigned to these sections before article was disallowed from WB Access.
Comment #27
agentrickardInteresting. That wasn't happening on the Workbench views, but only on a new custom View.
This patch moves that query element to the subquery, which is likely where it belongs.
Comment #28
avdp commentedThank you for this. Exactly what I needed. Normally I have a menu with some views-pages, and the rest of the menu-structure is created with taxonomy_menu.
So the main menu could be:
main_menu
- home
- views-page-listing news
- views-page-listing events
- taxonomy-term topic1
-- taxonomy-term topic1.1
- taxonomy-term topic2
- taxonomy-term topic3
I applied the patch and it sems to work (did not do anything with views).
Comment #29
agentrickardThanks @avdp.
One more review to go, and then we can commit.
Comment #30
dave reidQueuing to review
Comment #31
agentrickardMinor re-roll.
Comment #32
agentrickardRe-roll to fix tests against head.
Comment #33
agentrickardCommitting, since tests pass.