[Bps-public-commit] rt-extension-rightsdebugger branch, master, updated. 026f8c5f3822f0839d4653059125b666c07e8543

Shawn Moore shawn at bestpractical.com
Thu Feb 2 18:20:45 EST 2017


The branch, master has been updated
       via  026f8c5f3822f0839d4653059125b666c07e8543 (commit)
      from  bc1d6cefa3ce2f57e7422165d025043f55f157c0 (commit)

Summary of changes:
 html/Helpers/RightsDebugger/Search | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

- Log -----------------------------------------------------------------
commit 026f8c5f3822f0839d4653059125b666c07e8543
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Thu Feb 2 23:20:41 2017 +0000

    Filter by right name

diff --git a/html/Helpers/RightsDebugger/Search b/html/Helpers/RightsDebugger/Search
index b686949..cb8bb14 100644
--- a/html/Helpers/RightsDebugger/Search
+++ b/html/Helpers/RightsDebugger/Search
@@ -1,13 +1,21 @@
-<%ARGS>
-$Principal => ''
-$Object => ''
-$Right => ''
-</%ARGS>
 <%INIT>
 my @results;
 
 my $ACL = RT::ACL->new($session{CurrentUser});
-$ACL->UnLimit;
+
+my $has_search = 0;
+
+if ($ARGS{right}) {
+    $has_search = 1;
+    $ACL->Limit(
+        FIELD         => 'RightName',
+        OPERATOR      => 'STARTSWITH',
+        VALUE         => $ARGS{right},
+        CASESENSITIVE => 0,
+    );
+}
+
+$ACL->UnLimit unless $has_search;
 
 while (my $ACE = $ACL->Next) {
     my $principal = $ACE->PrincipalObj;

-----------------------------------------------------------------------


More information about the Bps-public-commit mailing list