Closed (fixed)
Project:
Taxonomy Access Control
Version:
4.6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Jun 2005 at 15:51 UTC
Updated:
8 Nov 2005 at 23:59 UTC
Jump to comment: Most recent file
Comments
Comment #1
johnalbinI'd like to reiterate tostinni's comment.
If a user edits a node assigned with a category for which that user only has "view" and "update" permission, the original category is not shown in the edit category pull-down. The only categories shown are those that the user has "create" permission for.
I'm trying to setup a public website that has mostly private content and I've set up a taxonomy like this:
I've given Authenticated Users the ability to view, update, delete, and create Private content and the ability to view and update Public content. I only want the admin to create Public content; the admin can then assign that node to a user to maintain.
Unfortunately, the user cannot maintain that content without the category switching from "Public" to "Private".
This is a show stopper for this kind of website. Because the users (who are capable of editing content) are not knowledgeable enough to be admins and should NOT be given the ability to create public content.
Comment #2
johnalbinI believe I've fixed this issue.
The problem was that
taxonomy_node_formcausestaxonomy_accessto check'create'access when a node is being updated.taxonomy_node_formcan tell the node is being edited by checking$node->nid, but that info is not passed totaxonomy_formand then on to_taxonomy_term_select. Ultimately, it is_taxonomy_term_selectthat checks the 'update' privilige and generates the items in the taxonomy pull-down.The attached patch works with the 4.6 taxonomy.module that has already been patched with 4.6 taxonomy_access's taxonomy.patch.
I hope the maintainers will find this patch useful.
Comment #3
tostinni commentedThanks for the patch, I didn't took the time to check it ;)
Change the status.
Comment #4
johnalbinUnfortunately, my patch is only a partial fix.
While it does now display taxonomy terms for which the user has 'update' privileges. You can't actually save those terms back to the database. I need to fix all those hard coded instances of checking for 'create' privileges.
Whoops. Guess this explain why one should never patch at 4am.
I will get this fixed soon, as I need it for a site this week. But, in the interim, I wanted to let people know that the patch doesn't completely work.
Comment #5
johnalbinOkay, I think I've got this fixed proper now.
In addition to the work I specified in my last (partial) patch, I had to edit taxonomy.module's
taxonomy_nodeapiandtaxonomy_node_save.taxonomy_nodeapiis called when saving a node and knows whether a node is being updated or created, but this info is not passed totaxonomy_node_save. It istaxonomy_node_savethat checkstaxonomy_access, so it needs to know whether it is updating or creating a node.As I said before, the attached patch works with the 4.6 taxonomy.module that has already been patched with 4.6 taxonomy_access's taxonomy.patch.
Comment #6
keve commentedThanks, JohnAlbin.
I commited your patch to latest 4.6 version of taxonomy_access.module