Great module, almost exactly what I was thinking about building before deciding to check that someone else hadn't already...

However my needs are not quite met, as the title states....

Setup

Roles
RoleA
RoleB

Vocabulary
Visibility

  • all
  • RoleA Only
  • RoleB Only

Users are either assigned RoleA OR RoleB (never both)

Tac Lite schema is set up as terms and roles imply.

Currently a user of RoleA can not set visibility to RoleB Only and I assume this is by design. And it makes sense, as by doing so the user would deny himself access to content which they had created. Would like to see the ability to allow this to happen and yet allow author access to their content. This would essentially allow for some strange relationships but is requested by a client.

Will attach a patch with crack at it, that seems to work and is configurable on the tac_lite schema settings pages

Comments

JimBroad’s picture

StatusFileSize
new11.21 KB

Attaching proposed patch...

Also if someone might know a a module better suited for the above requirement, would appreciate any hints...

JimBroad’s picture

StatusFileSize
new11.27 KB

In hindsight, last patch was incorrect....

Please disregard it, but do see the following patch

Dave Cohen’s picture

tac_lite does try to hide terms from users who can't see them. this is done in tac_lite_db_rewrite_sql. I think all you need is a variable which prevents that function from doing anything, something I've been thinking about adding anyway. That is, if I understand you correctly.

The patch you've submitted strikes me as pretty complex. I don't want to support that, but I think the easier change will do what you need.

As for allowing the author to continue to see the node, sounds like a job for hook_access, or another node_access module.

JimBroad’s picture

Thanks for the reply Dave,

The above patch does handle both issues, and the patch is quite simple -- upon review its apparent complexity seems to be a result of my new editor cleaning up some tabs and spacing in the original -- sorry about that.

Will try to get a cleaner patch in there for you.

JimBroad’s picture

StatusFileSize
new2.26 KB

Attaching patch that does not mess with spacing, as you can see its much simpler and seems to fit nicely in with the existing methods, in order to allow author access after assigning to outside term, it only adds an extra node_access entry for that particular node...

Dave Cohen’s picture

Version: 6.x-1.3 » 6.x-1.x-dev
Status: Active » Needs review

I checked in a change (which I actually meant to check in a while back) to make the rewrite_sql configurable.

Try the latest 6.x-1.x-dev build (or CVS DRUPAL-6--1 branch). Uncheck the "Term Visibility" checkbox on each scheme. That way, users will see all terms, even if they can't see the nodes associated with them.

As for the author-based permissions... I still don't think they belong in a module that's all about taxonomy. Maybe there's already a node_access module to handle that? Or drupal's "edit own ..." permissions may be enough?

(note that what needs review is not the patch above. Instead, the change I just checked in CVS...)

bkraegelin’s picture

Just came across the same problem, this patch works for me.
Thanks.

My situation:

I created a nodetype for security incident logging and implemented a visibility in rings. (Sorry, being german native speaker, I don't know the exact english term.)

The author may set visibility to author only, author + members of CERT team, or author + CERT + IT security officers within company.

I implemented this using tac_lite, using taxonomy terms for permissions is very intuitive. But in this scenario the author cannot see his own node.

Please implement the patch in the module, it's a great enhancement.

dankh’s picture

This patch is a must. It introduces the "role of author" in the access flow. I applied the patch and now TAC lite is doing exactly what I need. Without this patch many complex workflows (Module Grants + TAC lite + Worflow) are impossible.

Thanks all of you for the great work so far.

Dave Cohen’s picture

Status: Needs review » Needs work

I know this thread is years old. Just taking another look at it, in part because bkraegelin reminded me that he finds it useful.

I'm glad it is here in the queue for those who wish to apply it. However, I'm not inclined to apply it to the module. Here's a few thoughts...

First, tac_lite.module is basically about taxonomy. This patch adds some logic that is all about authorship. My first thought is the authorship logic should be elsewhere. Drupal's permissions, for example, could allow an author to edit his/her own nodes. This would avoid an extra row in the node_access table (which contains the author's uid, information already stored in node table).

The patch as it is gives authors view, update and delete priviliges on their own nodes. Not all drupal admins would want that. So again, I think the edit and update privileges should come from permissions, not node_access.

The patch changes behavior on the node/add and node/NNN/edit pages. It doesn't limit changes to the node form, it changes the entire page. So for example if you had a tag cloud block, or a menu with links to nodes, the content author would see more items when on the node/edit form than they would when navigating the rest of the site. This would be confusing and potentially reveal sensitive data.

I wonder whether most of you would not need this patch if you unchecked the "visibility" checkbox on your scheme. That way, node authors would always see all the terms in the edit form. They would also see all the terms (but not necessarily content tagged with those terms) when navigating the site. Would that solve the problem? Or do you really need a setting to hide terms when navigating a site, but show them when editing a node?

vladimiraus’s picture

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

Thank you for contribution. 👍
Drupal 6 is no longer supported. 🤷‍♂️
Closing as outdated. 🔐