Hello,
I would like to have the view/list/etc permission be a filter in views.
Our setup is unusual in a sense that there is a double-tier access to each node. All the nodes have general access, and everyone can post comments and read about the node, but they can view the video embedded in the node only if Taxonomy Access gives view permission. This is where it would be extremely helpful if I could set up a filter on TAC's view permission in Views.
Any ideas would be greatly appreciated.
Thanks,
Andrey.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | taxonomy_access-views-filters-1.patch | 8.62 KB | mr.andrey |
| #3 | taxonomy_access-views-filters.patch | 8.61 KB | mr.andrey |
| #2 | taxonomy_access_includes.tar_.gz | 1.06 KB | mr.andrey |
Comments
Comment #1
mr.andrey commentedBy the way, until now, I've had this working with an argument:
But unfortunately at around 300 nodes it gets overwhelmed, and just ignores the rest.
I need help translating this into a views filter.
Andrey.
Comment #2
mr.andrey commentedOK, here is the "patch" (sorry not sure how to do multi-file patches).
This adds filters for each of the TAC permissions: view, update, delete, create, list (see under Node).
In taxonomy_access.module, add this (to the bottom or anywhere really):
And unzip the attached "includes" folder file inside the taxonomy_access module folder.
I've tested and it seems to be working just fine.
Tutorial on how to write a Views filter
Best,
Andrey.
Comment #3
mr.andrey commentedHere's the actual patch. And just for reference, here's the command for creating recursive multi-file/folder patches:
Comment #4
xjmInteresting. I know there's a patch out for Views itself to filter by whether the user has Edit permission for the node, etc., but that would not cover TAC's create/list.
+1. I'll try to do some more testing with this patch.
Comment #5
lhristov commented/** EDITED
Great idea to add view filters. It is exactly what I need. It seems to not work for me for anything but the TAC grant view.
I get an error for each other filter field:
"Error: handler for node > taxonomy_access_update doesn't exist!"
If I'm trying to add TAC grant delete the error changes to
"Error: handler for node > taxonomy_access_delete doesn't exist!"
Any ideas?
Thanks
*/
Figured it out:
The names of the classes in the includes folder are wrong for each handler
class taxonomy_access_handler_filter_view
should become:
class taxonomy_access_handler_filter_create
Comment #6
mr.andrey commentedNice catch, thanks!
Here's the updated patch.
Comment #7
egghunter commentedSubscribing
Comment #8
xjmI'm now using this feature on one of my sites. Very nice. I plan on committing this with a few minor changes, unless anyone else reports any trouble with it.
Comment #9
xjmCommitted after some cleanup:
http://drupal.org/cvs?commit=416050
Comment #10
xjmThis feature is now available in the dev branch. One thing I notice is that this filter only returns term-specific grants for the node, and excludes grants inherited from vocabulary or global defaults. I have opened a separate issue for this at: #901938: Views filters exclude nodes with grants inherited from global or vocabulary defaults