In Storm Contrib we added a while ago a permission "view if project is assigned to team" for tickets, tasks and projects.
Maybe we could move this to storm?
Our use-case is that anyone can view and comment on all tickets, which his team works on.
Maybe also add edit and delete permissions, so others can set this to, if wanted.

Why the request to move this to storm?
It is hard to add additional permissions. What we do is to change the node_access function to our own in the hook_menu_alter, call the original node access function and if this return false, test if our case gets true. But for the ticket/task list this doesn't work, as this calls the stormticket_access_sql function directly, so there are missing tickets/task in this list. We added another page (my-tickets) to get around that (but not only because of this, also we wanted more information there, so this list won't get removed). For all the JS calls, we altered the function in the hook_menu_alter to our function, which is a copy of the original and only changes a view lines, to get this working.
In a nutshell its messy, what we do there and the original list and our list doesn't show the same content.

What are other opinions about this permission?
I'm clearly in favor to add this. ;)
I would write the patch of course.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

juliangb’s picture

Sounds like it would be much easier to have it in Storm.

kfritsche’s picture

Here a patch, which would add these permissions.

kfritsche’s picture

Status: Active » Needs review

Link to the storm contrib patch: #1460662: Move Permission: "view if project is assigned to team" to Storm
And setting it to needs review.

juliangb’s picture

I've read through - looks sensible.

Is this something that we can put in some automated tests with? I'm just concerned that the access rules are getting quite sophisticated and want to prevent accidentally breaking it at some point in the future...

kfritsche’s picture

This issue shouldn't be commited before #1448764: Ticketlist doesn't show edit link

Once this happens, i will add tests here, so it will also test these additional permissions..

juliangb’s picture

Status: Needs review » Needs work

The last submitted patch, storm_project_permission-1448818-2.patch, failed testing.