Problem/Motivation

Hierarchical Select allows to set a field widget to allow the user to create new items and levels for the used taxonomy. Unfortunately users lacking the permission edit terms in {taxonomy-id} still can insert new terms through the widget.

So it's not possible yet to allow inserting new terms to users with the edit permission while other users should only be allowed to use already existing terms.

Proposed resolution

Enhance code to check for the taxonomy edit permission. The included patch should fix the issue.

Remaining tasks

Apply included patch.

CommentFileSizeAuthor
hierarchical_select.module.patch6.91 KBksi

Comments

h3rj4n’s picture

Status: Needs review » Needs work
+++ hierarchical_select.module	2013-05-19 12:00:45.869565109 +0200
@@ -1,6 +1,6 @@
 <?php
-
 /**
+

Why?

I tried to apply the patch. Came back with the following:

[herjan@dev hierarchical_select (7.x-3.x)]$ git apply hierarchical_select.module_3.patch
hierarchical_select.module_3.patch:34: trailing whitespace.
  
hierarchical_select.module_3.patch:62: trailing whitespace.
  // - the user is allowed /has permission) to edit the taxonomy terms. 
error: patch failed: hierarchical_select.module:1697
error: hierarchical_select.module: patch does not apply

Did you create the patch the right way?

ksi’s picture

It's not a GIT patch (have to look how to do that; it is my first patch for a Drupal project).

Apply the patch this way:
copy the file into the Hierarchical Select module directory and execute:

cd .../sites/all/modules/hierarchical_select
patch -b hierarchical_select.module  hierarchical_select.module.patch
gold’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)

This does not appear to be an issue any more. At some point in the last 5 years it has been dealt to.

Tested by letting Anon be able to create Articles but not be able to edit that vocabulary. Set the HS to be editable. As a logged in user I could create new terms. As Anon I could not.