limit ticket creation queue dropdowns based on ACL, RT#7778
[freeside.git] / rt / lib / RT / System.pm
index 2a23e32..e61e35f 100644 (file)
@@ -189,6 +189,28 @@ sub SubjectTag {
     return grep !$seen{lc $_}++, values %$map;
 }
 
+=head2 QueueCacheNeedsUpdate ( 1 )
+
+Attribute to decide when SelectQueue needs to flush the list of queues
+  and retrieve new ones.  Set when queues are created, enabled/disabled
+  and on certain acl changes.  Should also better understand group management.
+
+If passed a true value, will update the attribute to be the current time.
+
+=cut
+
+sub QueueCacheNeedsUpdate {
+    my $self = shift;
+    my $update = shift;
+
+    if ($update) {
+        return $self->SetAttribute(Name => 'QueueCacheNeedsUpdate', Content => time);
+    } else {
+        my $cache = $self->FirstAttribute('QueueCacheNeedsUpdate');
+        return (defined $cache ? $cache->Content : 0 );
+    }
+}
+
 eval "require RT::System_Vendor";
 die $@ if ($@ && $@ !~ qr{^Can't locate RT/System_Vendor.pm});
 eval "require RT::System_Local";