[Rt-devel] RT 3.6.5 patch - Custom Fields Group Rights

Jesse Vincent jesse at bestpractical.com
Tue Jan 22 16:00:58 EST 2008


Thanks. Applied for 3.6.7


On Tue, Jan 22, 2008 at 03:47:24PM -0500, Stephen Turner wrote:
> 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

> --- 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);
> 

> _______________________________________________
> List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel


-- 


More information about the Rt-devel mailing list