[Rt-commit] r10435 - in rt/branches/3.6-RELEASE: .
jesse at bestpractical.com
jesse at bestpractical.com
Tue Jan 22 16:01:10 EST 2008
Author: jesse
Date: Tue Jan 22 16:01:09 2008
New Revision: 10435
Modified:
rt/branches/3.6-RELEASE/ (props changed)
rt/branches/3.6-RELEASE/html/Admin/CustomFields/GroupRights.html
Log:
r75548 at pinglin: jesse | 2008-01-22 16:00:36 -0500
* patch to clean up ACL updates from Steve Turner
Modified: rt/branches/3.6-RELEASE/html/Admin/CustomFields/GroupRights.html
==============================================================================
--- rt/branches/3.6-RELEASE/html/Admin/CustomFields/GroupRights.html (original)
+++ rt/branches/3.6-RELEASE/html/Admin/CustomFields/GroupRights.html Tue Jan 22 16:01:09 2008
@@ -109,60 +109,7 @@
$CustomFieldObj->Load($id) || $m->comp("/Elements/Error", Why => loc("Couldn't load CustomField [_1]",$id));
my $Groups;
-
- my ( $ACL, @results );
-
- foreach my $arg (keys %ARGS) {
- if ($arg =~ /GrantRight-(\d+)-(.*?)-(\d+)$/) {
- my $principal_id = $1;
- my $object_type = $2;
- my $object_id = $3;
- my $rights = $ARGS{$arg};
-
- my $principal = RT::Principal->new($session{'CurrentUser'});
- $principal->Load($principal_id);
- my $obj;
-
- if ($object_type eq 'RT::CustomField') {
- $obj = RT::CustomField->new($session{'CurrentUser'});
- $obj->Load($object_id);
- } else {
- push (@results, loc("System Error").
- loc("Rights could not be granted for [_1]", $object_type));
- next;
- }
-
- my @rights = ref($ARGS{$arg}) eq 'ARRAY' ? @{$ARGS{$arg}} : ($ARGS{$arg});
- foreach my $right (@rights) {
- next unless ($right);
- my ($val, $msg) = $principal->GrantRight(Object => $obj, Right => $right);
- push (@results, $msg);
- }
- }
- elsif ($arg =~ /RevokeRight-(\d+)-(.*?)-(\d+)-(.*?)$/) {
- my $principal_id = $1;
- my $object_type = $2;
- my $object_id = $3;
- my $right = $4;
-
- my $principal = RT::Principal->new($session{'CurrentUser'});
- $principal->Load($principal_id);
- next unless ($right);
- my $obj;
-
- if ($object_type eq 'RT::CustomField') {
- $obj = RT::CustomField->new($session{'CurrentUser'});
- $obj->Load($object_id);
- } else {
- push (@results, loc("System Error").
- loc("Rights could not be revoked for [_1]", $object_type));
- next;
- }
- my ($val, $msg) = $principal->RevokeRight(Object => $obj, Right => $right);
- push (@results, $msg);
- }
-}
-
+my @results = ProcessACLChanges(\%ARGS);
my $title = loc('Modify group rights for custom field [_1]', $CustomFieldObj->Name);
</%INIT>
More information about the Rt-commit
mailing list