Permission to assign case

timtrinidad - May 17, 2009 - 00:03
Project:Case Tracker
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work
Description

What happened to the ability to restrict the 'assign to' in casetracker? I see it's still a feature in 5.x, but was removed in 6.x.

#1

timtrinidad - May 19, 2009 - 15:40
Status:active» patch (to be ported)

I have attached a patch that does the following:

  • Adds a new permission: "assign Cases"
  • Gave the casetracker_user_options() function two arguments - the case node, and a boolean for whether or not to return all users. If the second argument is false, it returns the default assign_to, the current assign_to (from the passed $node), and the currently logged in user
  • Changed the line that calls that function to casetracker_user_options($node, user_acccess('assign cases'))

Dreamweaver does weird things with whitespace so I had to run diff with the w flag, so after patching the code might need some indentation adjustment.

AttachmentSize
casetrackerAssignPerm.patch 2.24 KB

#2

jmiccolis - May 27, 2009 - 12:57
Status:patch (to be ported)» needs review

Sorry I haven't gotten to this yet. if anyone else can help with a review in the meantime I'd appreciate it.

#3

jmiccolis - May 29, 2009 - 17:11
Status:needs review» needs work

I like the idea here, but there are two things we need to address with the current patch

  1. because casetracker_user_options() is used in the casetracker_views_handler_filter_user_options views handler we can't always assume we're using it in the context of a node. It should work also in that kind of 'filter form' context.
  2. I'd like it better if the permission check was inside of casetracker_user_options(). The function should be able to tell when it needs to run the check (if we're looking at a node) and so it's better to just take care of it inside that function.

If we can address those things this should be good to go.

#4

castawaybcn - November 27, 2009 - 17:07

I think this would be a great feature.
Subscribing

 
 

Drupal is a registered trademark of Dries Buytaert.