[Rt-devel] RT 3.6.5 patch - Custom Fields Group Rights
Stephen Turner
sturner at MIT.EDU
Tue Jan 22 15:47:24 EST 2008
I noticed that Admin/CustomFields/GroupRights.html has the ACL
update code inline, whereas the other Group Rights pages use the
ProcessACLChanges method in Web.pm. The code seems to be identical -
here's a patch to make the Custom Fields Group Rights screen
consistent with the others.
Thanks,
Steve
-------------- next part --------------
--- share/html/Admin/CustomFields/GroupRights.html 2007-04-24 13:21:42.000000000 -0400
+++ local/html/Admin/CustomFields/GroupRights.html 2008-01-22 15:41:10.000000000 -0500
@@ -110,58 +110,8 @@
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);
- }
-}
+ #Update the acls.
+ my @results = ProcessACLChanges(\%ARGS);
my $title = loc('Modify group rights for custom field [_1]', $CustomFieldObj->Name);
More information about the Rt-devel
mailing list