[Bps-public-commit] rtfm-extension-accesscontrols branch, master, updated. af53c6054bd1d324539341eae54b0b718542f910

Kevin Falcone falcone at bestpractical.com
Fri Sep 9 19:15:26 EDT 2011


The branch, master has been updated
       via  af53c6054bd1d324539341eae54b0b718542f910 (commit)
       via  ba3818c9a1df3a2eecc8c8aab9894a7af3af2675 (commit)
      from  35bd2c338c92b14ba69855b6b3fe8bf81ff7efb3 (commit)

Summary of changes:
 .gitignore                                         |    1 +
 .../Elements/Tabs/Default                          |    2 +-
 .../RTFM/Elements/BeforeMessageBox/Init            |    8 ++++++--
 lib/RTFM/Extension/AccessControls.pm               |    6 ++++--
 4 files changed, 12 insertions(+), 5 deletions(-)

- Log -----------------------------------------------------------------
commit ba3818c9a1df3a2eecc8c8aab9894a7af3af2675
Author: Kevin Falcone <kevin at jibsheet.com>
Date:   Fri Sep 9 19:11:28 2011 -0400

    A few final bugfixes and 3.8 compliance
    
    Use the same Right name in 2 places
    Use %ARGS to make ref passing easier
    Make the tab hiding logic go the right way around

diff --git a/html/Callbacks/RTFM-Extension-AccessControls/Elements/Tabs/Default b/html/Callbacks/RTFM-Extension-AccessControls/Elements/Tabs/Default
index f9b9575..e1bc8b2 100644
--- a/html/Callbacks/RTFM-Extension-AccessControls/Elements/Tabs/Default
+++ b/html/Callbacks/RTFM-Extension-AccessControls/Elements/Tabs/Default
@@ -1,6 +1,6 @@
 <%INIT>
 if ($toptabs->{'BB-RTFM'}) {
-    if ($session{CurrentUser}->HasRight( Right => 'ShowRTFMConfigTab', Object => $RT::FM::System )) {
+    unless ($session{CurrentUser}->HasRight( Right => 'ShowRTFMConfigTab', Object => $RT::FM::System )) {
             delete $toptabs->{'BB-RTFM'};
     }
 }
diff --git a/html/Callbacks/RTFM-Extension-AccessControls/RTFM/Elements/BeforeMessageBox/Init b/html/Callbacks/RTFM-Extension-AccessControls/RTFM/Elements/BeforeMessageBox/Init
index 91262e4..c608190 100644
--- a/html/Callbacks/RTFM-Extension-AccessControls/RTFM/Elements/BeforeMessageBox/Init
+++ b/html/Callbacks/RTFM-Extension-AccessControls/RTFM/Elements/BeforeMessageBox/Init
@@ -1,5 +1,9 @@
 <%INIT>
-unless ($session{CurrentUser}->HasRight( Right => 'ShowArticleSelectionCreateReply', Object => $ARGS{Queue} )) {
-   $ARGS{skip} = 1;
+unless ($session{CurrentUser}->HasRight( Right => 'ShowArticleSelection', Object => $Queue )) {
+   $$skip = 1;
 } 
 </%INIT>
+<%ARGS>
+$skip => undef
+$Queue => undef
+</%ARGS>
diff --git a/lib/RTFM/Extension/AccessControls.pm b/lib/RTFM/Extension/AccessControls.pm
index 51dafe3..c4b7407 100644
--- a/lib/RTFM/Extension/AccessControls.pm
+++ b/lib/RTFM/Extension/AccessControls.pm
@@ -8,7 +8,9 @@ use strict;
 BEGIN {
     RT::FM::System->AddRights( ShowRTFMConfigTab => "show RTFM configuration tab" );
     RT::Queue->AddRights( ShowArticleSelection => "Show Canned Replies on the Create and Update page" );
-    RT::Queue->AddRightCategories( ShowArticleSelection => "General" );
+    if (RT::Queue->can('AddRightCategories')) {
+        RT::Queue->AddRightCategories( ShowArticleSelection => "General" );
+    }
 }
 
 
@@ -40,7 +42,7 @@ You will need a SuperUser to re-enable the RTFM menu.
 
 This module provides two new ACLs
 
- ShowArticleSelectionCreateReply
+ ShowArticleSelection
     This Right allows you to only show the RTFM search and updates to a
     restricted set of users
 

commit af53c6054bd1d324539341eae54b0b718542f910
Author: Kevin Falcone <kevin at jibsheet.com>
Date:   Fri Sep 9 19:14:26 2011 -0400

    useful ignores

diff --git a/.gitignore b/.gitignore
index ca01e42..9fe1ef6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,3 +12,4 @@ pod2htm*.tmp
 /RTFM-Extension-AccessControls-*
 README
 /MYMETA.*
+*.swp

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



More information about the Bps-public-commit mailing list