[Rt-commit] rt branch, rightsmatrix, updated. rt-3.8.8-608-gd4b552a
Thomas Sibley
trs at bestpractical.com
Mon Aug 30 17:29:16 EDT 2010
The branch, rightsmatrix has been updated
via d4b552a6c5415ade24c68a0cecffb8f527c3bfdc (commit)
via a2f018cba22512c4bc22930446d557f5de2c6d4e (commit)
from 6d74fdb24706cc53fd5367f9d084d1bfcf77433c (commit)
Summary of changes:
share/html/Admin/Elements/EditRights | 43 +++++++++++++++++++++++++++++-
share/html/Admin/Groups/GroupRights.html | 2 +-
share/html/NoAuth/js/userautocomplete.js | 2 +-
3 files changed, 44 insertions(+), 3 deletions(-)
- Log -----------------------------------------------------------------
commit a2f018cba22512c4bc22930446d557f5de2c6d4e
Author: Thomas Sibley <trs at bestpractical.com>
Date: Mon Aug 30 17:25:30 2010 -0400
Fix principal map group name
diff --git a/share/html/Admin/Groups/GroupRights.html b/share/html/Admin/Groups/GroupRights.html
index 4311ee4..68382e9 100755
--- a/share/html/Admin/Groups/GroupRights.html
+++ b/share/html/Admin/Groups/GroupRights.html
@@ -68,7 +68,7 @@ if (!defined $id) {
my $GroupObj = RT::Group->new($session{'CurrentUser'});
$GroupObj->Load($id) || Abort(loc("Couldn't load group [_1]",$id));
-my @principals = GetPrincipalsMap($GroupObj, 'System', 'User Groups');
+my @principals = GetPrincipalsMap($GroupObj, 'System', 'Groups');
</%INIT>
<%ARGS>
commit d4b552a6c5415ade24c68a0cecffb8f527c3bfdc
Author: Thomas Sibley <trs at bestpractical.com>
Date: Mon Aug 30 17:26:13 2010 -0400
Basic framework for adding rights to a new principal (users, groups)
This ability is required since now we only show users/groups with rights
granted.
Left todo for this feature: group autocomplete and actual handling in
ProcessACLChanges. User autocomplete should be restricted to
Privileged.
diff --git a/share/html/Admin/Elements/EditRights b/share/html/Admin/Elements/EditRights
index dc9839b..8fb5bf0 100644
--- a/share/html/Admin/Elements/EditRights
+++ b/share/html/Admin/Elements/EditRights
@@ -1,9 +1,20 @@
<%args>
$Context
$Principals
+$AddPrincipal => undef
</%args>
<%init>
use Scalar::Util qw(blessed);
+
+unless ( $AddPrincipal ) {
+ my $last = $Principals->[-1];
+ if ( $last->[0] =~ /Groups/i ) {
+ $AddPrincipal = 'group';
+ }
+ elsif ( $last->[0] =~ /Users/i ) {
+ $AddPrincipal = 'user';
+ }
+}
</%init>
%# Principals is an array of arrays, where the inner arrays are like:
%# [ 'Category name' => $CollectionObj => 'DisplayColumn' => 1 ]
@@ -34,6 +45,16 @@ for my $category (@$Principals) {
}
}
</%perl>
+% if ( $AddPrincipal ) {
+ <li class="category"><&|/l&>Add</&> <% loc($AddPrincipal) %></li>
+ <li>
+ <a href="#acl-addprincipal">
+ <input type="text" value=""
+ name="AddPrincipalForRights-<% lc $AddPrincipal %>"
+ id="AddPrincipalForRights-<% lc $AddPrincipal %>" />
+ </a>
+ </li>
+% }
</ul>
<%perl>
@@ -72,7 +93,7 @@ for my $category (@$Principals) {
</%perl>
<div id="<% $id %>">
- <h3>Rights for <% $loc ? loc($display) : $display %></h3>
+ <h3><&|/l&>Rights for</&> <% $loc ? loc($display) : $display %></h3>
<ul class="rights-list">
% for my $right (sort keys %available_rights) {
<li>
@@ -92,5 +113,25 @@ for my $category (@$Principals) {
<%perl>
}
}
+
+if ( $AddPrincipal ) {
+ my $acldesc = join '-', 'addprincipal', ref($Context), $Context->Id;
</%perl>
+ <div id="acl-addprincipal">
+ <h3><&|/l&>Add rights for this</&> <% loc($AddPrincipal) %></h3>
+ <ul class="rights-list">
+% for my $right (sort keys %available_rights) {
+ <li>
+ <input type="checkbox" class="checkbox"
+ name="SetRights-<% $acldesc %>"
+ id="SetRights-<% $acldesc %>-<% $right %>"
+ value="<% $right %>" />
+ <label for="SetRights-<% $acldesc %>-<% $right %>" title="<% $right %>">
+ <% loc($available_rights{$right}) %>
+ </label>
+ </li>
+% }
+ </ul>
+ </div>
+% }
</div>
diff --git a/share/html/NoAuth/js/userautocomplete.js b/share/html/NoAuth/js/userautocomplete.js
index b296d0c..8944f5c 100644
--- a/share/html/NoAuth/js/userautocomplete.js
+++ b/share/html/NoAuth/js/userautocomplete.js
@@ -3,7 +3,7 @@ jQuery(function() {
var multipleCompletion = new Array("Requestors", "To", "Bcc", "Cc", "AdminCc", "WatcherAddressEmail[123]", "UpdateCc", "UpdateBcc");
// inputs with only a single email address allowed
- var singleCompletion = new Array("(Add|Delete)Requestor", "(Add|Delete)Cc", "(Add|Delete)AdminCc");
+ var singleCompletion = new Array("(Add|Delete)Requestor", "(Add|Delete)Cc", "(Add|Delete)AdminCc", "AddPrincipalForRights-user");
// build up the regexps we'll use to match
var applyto = new RegExp('^(' + multipleCompletion.concat(singleCompletion).join('|') + ')$');
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list