Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
best-practical
rtir
Commits
97a2444a
Commit
97a2444a
authored
Mar 25, 2014
by
Kevin Falcone
Browse files
Merge branch '3.0/cache-queues-hasright' into 3.0-trunk
parents
33e29060
1f5fb2a9
Changes
5
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
97a2444a
...
...
@@ -11,3 +11,4 @@ MYMETA.*
/etc/upgrade/2.5.1/update_saved_searches.pl
/lib/RT/IR/Test.pm
.prove
RT-IR-*.tar.gz*
MANIFEST.SKIP
View file @
97a2444a
.*\.tar\.gz$
.*.asc$
^releng\.cnf$
^blib/
^pm_to_blib
...
...
META.yml
View file @
97a2444a
...
...
@@ -32,4 +32,4 @@ requires:
perl
:
5.8.3
resources
:
license
:
http://opensource.org/licenses/gpl-license.php
version
:
3.0.
0
version
:
3.0.
1rc1
html/RTIR/Create.html
View file @
97a2444a
...
...
@@ -242,7 +242,7 @@
% $include_signature = 0;
% }
% if ( RT->Config->Get('ArticleOnTicketCreate')) {
<
&
/
Articles
/
Elements
/
BeforeMessageBox
,
%
ARGS
&
>
<
&
/
Articles
/
Elements
/
BeforeMessageBox
,
%
ARGS
,
QueueObj =
>
$QueueObj
&
>
% }
% $m->callback( %ARGS, CallbackPage => '/Ticket/Create.html', CallbackName => 'BeforeMessageBox' );
% if ( $ARGS{Content} ) {
...
...
lib/RT/IR.pm
View file @
97a2444a
...
...
@@ -52,7 +52,7 @@ use warnings;
package
RT::
IR
;
our
$VERSION
=
'
3.0.
0
';
our
$VERSION
=
'
3.0.
1rc1
';
use
Scalar::
Util
qw(blessed)
;
...
...
@@ -621,6 +621,7 @@ if ( RT::IR->HasConstituency ) {
wrap
'
RT::Interface::Web::Handler::CleanupRequest
',
pre
=>
sub
{
%
RT::IR::
ConstituencyCache
=
();
%
RT::IR::
HasNoQueueCache
=
();
RT::IR::
_FlushQueueHasRightCache
();
};
require
RT::
Record
;
...
...
@@ -699,6 +700,7 @@ if ( RT::IR->HasConstituency ) {
return
;
};
my
$queue_cache
=
{};
wrap
'
RT::Queue::HasRight
',
pre
=>
sub
{
return
unless
$_
[
0
]
->
id
;
return
if
$_
[
0
]
->
{'
disable_constituency_right_check
'};
...
...
@@ -710,16 +712,26 @@ if ( RT::IR->HasConstituency ) {
my
%args
=
(
@_
[
1
..
(
@
_
-
2
)]);
$args
{'
Principal
'}
||=
$_
[
0
]
->
CurrentUser
;
my
$queues
=
RT::
Queues
->
new
(
RT
->
SystemUser
);
$queues
->
Limit
(
FIELD
=>
'
Name
',
OPERATOR
=>
'
STARTSWITH
',
VALUE
=>
"
$name
-
"
);
my
$equiv_objects
;
if
(
$queue_cache
->
{
$name
}
)
{
$equiv_objects
=
$queue_cache
->
{
$name
};
}
else
{
my
$queues
=
RT::
Queues
->
new
(
RT
->
SystemUser
);
$queues
->
Limit
(
FIELD
=>
'
Name
',
OPERATOR
=>
'
STARTSWITH
',
VALUE
=>
"
$name
-
"
);
$equiv_objects
=
$queues
->
ItemsArrayRef
;
$queue_cache
->
{
$name
}
=
$equiv_objects
;
}
my
$has_right
=
$args
{'
Principal
'}
->
HasRight
(
%args
,
Object
=>
$_
[
0
],
EquivObjects
=>
$qu
eues
->
ItemsArrayRef
,
EquivObjects
=>
$
e
qu
iv_objects
,
);
$_
[
-
1
]
=
$has_right
;
return
;
};
sub
_FlushQueueHasRightCache
{
undef
$queue_cache
};
require
RT::
Queue
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment