Used d-4.5, test report in using this module Revision 1.34

After installing the module (applying patch to taxonomy.module, mysql table ). I created two categories with name Private and Public

2 nodes (image and poll) assigned to Private Category with 2 terms namely pv_term_1, pv_term2

2 nodes (personal blog entry and forum ) assigned to Public category with 2 terms namely pb_term1 and pb_term2

I applied category permissions (view, update, delete create) settings to two roles namely authenticated user and family as follows

Authenticated User :
Private : Default and two terms to Remove
Public : Default and two terms to Add

Family:
Private : Default and two terms to Add
Public : Default and two terms to Remove

Observed output:
Logged in as authenticated user, could able to see public with no terms for its 2 nodes( as mentioned above)
Logged in as family user, could able to see private with no terms for its 2 nodes (as mentioned above)

Desired output : Category with respective terms for assigned roles as per the category permissions

Would like to share tables entry, if required

Comments

Gunny-1’s picture

StatusFileSize
new2.34 KB

I have attached entires of node_access, term_access, term_access_defaults and term_data

pyromanfo’s picture

First, your post is very confusing because I think you have the terminology confused.

Categories and Terms are the same thing. Categories go into Vocabularies. From your SQL, you have four categories going into two vocabularies.

With that out of the way, the second thing is that you don't have view permissions set for those categories, that's why they're not showing up. Even if someone has add/delete/whatever access, it's not going to be viewable when they don't have view permissions, that's the way it's supposed to work.

Gunny-1’s picture

I forgot to this information in my first post, here it is
Would like to add that i enabled taxonomy_access from settings after (applying patch to taxonomy.module, mysql table )

pyromanfo’s picture

Also I wanna say thanks for the database file, that helped alot.

Gunny-1’s picture

Sorry my terminology got screwed up.
I cross checked the user/configure/category permissions/{roles} the view is already enabled (checked) for the respective vocabularies and categories.

I think the entry is not getting inserted in to the table.

FYI, i have not checked the four permissions for uncategorized nodes.

pyromanfo’s picture

That checkbox comes from the database, so I don't see how it could be getting checked.

For a specific example, try anonymous users (role 1) for pb_term1 or pb_term2, view shouldn't be checked in either place (as it's not set in the DB).

Gunny-1’s picture

error in the path in my previous post
it should read, administer/users/configure/category permissions

Gunny-1’s picture

Ok, results for anonymous user

Default : Update, Delete, Create checked, view not checked
pb_term1 : Update, Delete, Create checked, view not checked

pb_term2: none of the permissions are checked

Gunny-1’s picture

oops, i shall post the tables in couple of minutes

pyromanfo’s picture

So the anonymous user shouldn't be seeing this category, because view isn't checked.

Without view, the user shouldn't even know the category is there.

Gunny-1’s picture

StatusFileSize
new2.34 KB

i have enclosed the table details after updating the permissions for anonymous user.

well when i tried to enable the category block i got this error,
Call to undefined function: node_rewrite_sql() in modules/taxonomy.module on line 110

Gunny-1’s picture

StatusFileSize
new48.13 KB

well i can disable the category block by going to the database. But this error appears with the taxonomy_access patch applied to taxonomy.module

here is my taxonomy.module after applying the patch for taxonomy_access.module

pyromanfo’s picture

Yeah that's not my code, that's a core function.

But are the categories showing up now that you have view enabled?

Gunny-1’s picture

>For a specific example, try anonymous users (role 1) for pb_term1 or pb_term2, view shouldn't be checked >in either place (as it's not set in the DB).

Test result after
Default : Update, Delete, Create checked, view not checked
pb_term1 : Update, Delete, Create checked, view not checked

when anonmyous user create's content for forum he can able to see the vocabulary public with no terms.

so i think the view is not working if i am right.

pyromanfo’s picture

No that's entirely right. View isn't checked, so the anonymous user cannot see those categories. That's the way it's supposed to work.

Gunny-1’s picture

yes, when i enable the view for anonymous user for pbterm1 the categories are showing up. Let me do some more testing

Gunny-1’s picture

Testing completed, module working as desired.

Naming a vocabulary as "Private" i think it is taken as reserved key word?
Weird

It seems so, because when i enabled the view for Private still i couldnt get the category/term listed. Then i created additional vocabulary called Check and added a term check1.

The categories were showing up as desired.

Quotes disappeared (just got n/a in the place of quote) while i was testing the taxonomy_access for all the roles except super-user.

I inserted this in node_access table
INSERT INTO node_access VALUES (0, 0, 'all', 1, 0, 0);

now i got the quotes showing up for all the roles.

Can i have the above values in node_access table for taxonomy_access to work properly. I think this gets deleted when taxonomy_access is enabled through setting.

Gunny-1’s picture

No with this INSERT INTO node_access VALUES (0, 0, 'all', 1, 0, 0);
taxonomy_access.module doesnt work. i have to disable it to get it working. There may be many modules with this problem.

Is there a solution to change the permission settings in the quotes.module to get it work. This will be a generic solution for all other modules with the same problem.

pyromanfo’s picture

Yes enabling the module removes that last bit of SQL you posted. Disabling the module inserts it. That's what it's supposed to do, override taxonomy_access or any other node based access.

Anonymous’s picture

I disabled the checkbox for all the permissions for anonymous user role but still the Check and public vocabularies are visible (in create content).

Desired output: The role should not view the vocabulary as all the permissions are unchecked

Gunny-1’s picture

The previous post was mine (forgot to login)

pyromanfo’s picture

Could you post the SQL again?

Gunny-1’s picture

StatusFileSize
new1.83 KB

attached

Gunny-1’s picture

I observed other problems (refer to #18 submitted by Gunny on February 9, 2005 - 15:18 at the bottom of the page)

user roles other than super user cannot see their blog postings in "my blog". By inserting this statement INSERT INTO node_access VALUES (0, 0, 'all', 1, 0, 0);

it solved the issue.

But i can't use the taxonomy_access now. This is a critical issue and so far i have encountered permission problems for quotes and blog modules may be other modules may have the same problem too. This happens only if taxonomy_access is installed as a result above entry gets deleted.

malfunct’s picture

StatusFileSize
new30.12 KB

I have an issue that I think is similar so I won't file a new report.

What I'm seeing is that when I'm logged out, none of the terms of the Employment vocabulary show. This is expected as anonymous user does not have view permission in the category.

However, when I log in as test_user, an authenticated user, he cannot see any terms under the Employment vocabulary either.

When someone who is a programmer_op role logs in, they can see the terms under the Employment category just fine as can the admin account.

I have no idea whats happening as when I look in the database permissions seem ok so all I can think of is somewhere authenticated users are getting taxonomy access based on the anonymous users settings, at least in some places as an authenticated user (so far as I know, it might have recently gotten messed up with a cvs version I loaded up) is able create nodes in the User Submissions vocabulary under the Submissions term.

I am attaching the relevant sql. The user table has been truncated and passwords cleaned up for obvious reasons.

carl ditzler’s picture

I'm interested in similar desired output: Category A is public, anonymous can access, and Cat B is private, anonymous can't access, I don't want public/anonymous to see Cat B even exists.

I turn navigation off for anonymous users, registered users enabled navigation.

When anonymous users go to category A, navigation is displayed, listing Cat B. Anonymous users can't access Cat B, but it is listed in navigation.

Understand navigation is separate from this module; the two are related. Ensuring privacy to some taxonomy would include not seeing that it exists?

pyromanfo’s picture

Yes however that's the navigation module, we have no control over that. If navigation was using the taxonomy.module functions to find the terms it wouldn't be there, but it seems they're not so you'll have to ask them to add support for taxonomy_access.

Periastron@spreadfirefox.com’s picture

Actually, it appears that taxonomy_get_tree should drop categories from the list if they don't have view permission; however, there appears to be a bug in taxonomy_access itself, which prevents it from getting the correct role IDs for a particular user. Specifically, this code in taxonomy_access:

  if (isset($user)) {
    $user_object = user_load(array('uid' => $uid));
  }
  else {
    $user_object = $user;
  }

should probably read:

  if (!isset($user)) {
    $user_object = user_load(array('uid' => $uid));
  }
  else {
    $user_object = $user;
  }

When I make this change in the module, I can finally create a private forum that isn't even visible in the forum list, if the user doesn't have a role with the appropriate permission assigned for the forum.

pyromanfo’s picture

Thanks! Commited to CVS. I was having a hard time figuring this one out. That should fix the original poster's problems.

Gunny-1’s picture

No, it doesnt fix the problem. When i check the view for a term under a category for anonymous user. The create content shows only the category and not the term.

pyromanfo’s picture

Terms and Categories are the same thing, what do you mean exactly?.

Gunny-1’s picture

I am kinda getting screwed up with the terminology i meant vocabulary is still visible in the create content section even after disabling the view from category permissions.

pyromanfo’s picture

That's not a bug, Taxonomy Access Control doesn't control access to vocabularies. Just Categories. So while the category isn't showing up, the vocabulary always will because TAC doesn't control that at all.

Anonymous’s picture

so we can add a vocabulary and terms to a role but can remove only terms and not vocabulary .

so if the admin adds more vocabularies to a role, and when he decides to strip the access to some of the vocabulary he is stuck. The vocabulary will be still visible to the user.

May be in the help file it can be mentioned that vocabulary once enabled for a role cannot be removed later.

is there a workaround ?

Well there is one more problem as mentioned here http://drupal.org/node/17095#comment-21525,
apart from admin other users cannot view their blogs they have posted in 'my blogs'. Can i post this as a separate bug?

Gunny-1’s picture

the previous comment was posted by me

pyromanfo’s picture

No, you can't vocabularies either. This module does not control vocabularies. They are always shown. This module does not touch them.

pyromanfo’s picture

Sorry, it should read "You can't add vocabularies either"

Gunny-1’s picture

well, here is another test case,

consider there are two categories with sub-categories for a vocabulary

if i enable all the permissions first category and select add (similarly for remove) then submit.

both the categories and sub categories are selected.

desired output: only first category should be selected.

this happens only when i select add and submit and if i dont select add (with checkbox enabled for the category) and just press submit, its fine.

Gunny-1’s picture

please comment on this too,
http://drupal.org/node/17095#comment-21525,

thanks

malfunct’s picture

The issue I was seeing was fixed in the most recent CVS verstion. Sorry it took me so long to try it out.

keve’s picture

Status: Active » Closed (fixed)