[rt-devel] Additional Queue Roles patch

B. Bell bradleyb at u.washington.edu
Wed Apr 7 21:40:08 EDT 2004


Hmm, I just fixed it - pretty trivial change, but I think it's correct.

-brad

On Wed, 7 Apr 2004, Bradley Bell wrote:
>
> Is there something I missed?  or is this part just not done yet?
>
> -brad
>
-------------- next part --------------
--- lib/RT/Queue_Overlay.pm	Thu Apr  1 14:32:05 2004
+++ local/lib/RT/Queue_Overlay.pm	Wed Apr  7 18:00:35 2004
@@ -852,6 +852,52 @@
 
 # }}}
 
+# {{{ sub Dispatcher
+
+=head2 Dispatcher
+
+Takes nothing.
+Returns an RT::Group object which contains this Queue's Dispatchers.
+If the user doesn't have "ShowQueue" permission, returns an empty group
+
+=cut
+
+sub Dispatcher {
+    my $self = shift;
+
+    my $group = RT::Group->new($self->CurrentUser);
+    if ( $self->CurrentUserHasRight('SeeQueue') ) {
+        $group->LoadQueueRoleGroup(Type => 'Dispatcher', Queue => $self->Id);
+    }
+    return ($group);
+
+}
+
+# }}}
+
+# {{{ sub QueueAdmin
+
+=head2 QueueAdmin
+
+Takes nothing.
+Returns an RT::Group object which contains this Queue's QueueAdmins.
+If the user doesn't have "ShowQueue" permission, returns an empty group
+
+=cut
+
+sub QueueAdmin {
+    my $self = shift;
+
+    my $group = RT::Group->new($self->CurrentUser);
+    if ( $self->CurrentUserHasRight('SeeQueue') ) {
+        $group->LoadQueueRoleGroup(Type => 'QueueAdmin', Queue => $self->Id);
+    }
+    return ($group);
+
+}
+
+# }}}
+
 # {{{ IsWatcher, IsCc, IsAdminCc
 
 # {{{ sub IsWatcher


More information about the Rt-devel mailing list