Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Request Tracker: Devel

Creating Rights: AssignTicket, howto

 

 

Request Tracker devel RSS feed   Index | Next | Previous | View Threaded


tcp at cat

Nov 12, 2003, 7:35 AM

Post #1 of 1 (2621 views)
Permalink
Creating Rights: AssignTicket, howto

rt-devel:

I just wanted to post a quick blurb about how to create a custom right
in RT, as I've seen some mention of this in the list archives without
explanation. The following is what I did. Its pretty simple.
1) Add the right in the Queue_Overlay.pm file;
1) Modify Ticket_Overlay.pm ( or other files ) to reflect the logic
of the right;

* see the diff files *

The new right will show up in the database once you assign it to some
groups or users. So far, I haven't noticed any other libs or templates that
needed to be changed, but if I missed something, please let me know.

I think an AssignTicket right would be a great addition to future releases
of RT.

just me
tcp



| PrincipalType | RightName | Description |
+---------------+--------------+--------------------------------------+
| Group | AssignTicket | Assigns Tickets to Queues and People |
| Owner | AssignTicket | SystemRolegroup for internal use |
+---------------+--------------+--------------------------------------+
2 rows in set (0.00 sec)



# Diffs against lib files from RT 3.0.5

# Queue_Overlay.pm
90a91
> AssignTicket => 'Assign tickets',


# Ticket_Overlay.pm

1914c1914,1915
< unless ( $self->CurrentUserHasRight('ModifyTicket') ) {
---
> unless ( $self->CurrentUserHasRight('ModifyTicket')
> || $self->CurrentUserHasRight('AssignTicket') ) {
1948c1949,1950
< return ( $self->_Set( Field => 'Queue', Value => $NewQueueObj->Id() ) );
---
> return ( $self->_Set( Field => 'Queue', Value => $NewQueueObj->Id(), CheckACL => 0 ) );
> # Toby, disabled the CheckACL since we've done it already
3055c3057,3058
< || $self->CurrentUserHasRight('StealTicket') ) {
---
> || $self->CurrentUserHasRight('StealTicket')
> || $self->CurrentUserHasRight('AssignTicket') ) {
3060c3063,3064
< unless ( $self->CurrentUserHasRight('ModifyTicket') ) {
---
> unless ( $self->CurrentUserHasRight('ModifyTicket')
> || $self->CurrentUserHasRight('AssignTicket') ) {
3077,3079c3081,3084
< ( $self->OwnerObj->Id != $RT::Nobody->Id ) and #and the owner is set
< ( $self->CurrentUser->Id ne $self->OwnerObj->Id() )
< ) { #and it's not us
---
> ( $self->OwnerObj->Id != $RT::Nobody->Id ) and #and the owner is set
> ( $self->CurrentUser->Id ne $self->OwnerObj->Id() ) and #and it's not us
> ( ! $self->CurrentUserHasRight('AssignTicket') ) #and we cannot assign tickets
> ) {
_______________________________________________
rt-devel mailing list
rt-devel [at] lists
http://lists.fsck.com/mailman/listinfo/rt-devel

Request Tracker devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.