[Rt-commit] rt branch, 4.2/user-transactions-privileged-groups, repushed
Dustin Graves
dustin at bestpractical.com
Fri Jun 10 15:03:52 EDT 2016
The branch 4.2/user-transactions-privileged-groups was deleted and repushed:
was 33f3d85a417b9779bbde3aa69d93d50d2a4ea86a
now c050da1e30cefe841a528114429a9656c1c1ac32
1: 8df67c5 ! 1: 41292a3 log a transaction when setting or unsetting Privileged status on a User
@@ -10,10 +10,10 @@
my ($status, $msg) = $priv->_AddMember( InsideTransaction => 1, PrincipalId => $principal);
if ($status) {
+ $self->_NewTransaction(
-+ Type => 'Set',
-+ Field => 'Privileged',
-+ NewValue => 1,
-+ OldValue => 0,
++ Type => 'Set',
++ Field => 'Privileged',
++ NewValue => 1,
++ OldValue => 0,
+ );
return (1, $self->loc("That user is now privileged"));
} else {
@@ -23,10 +23,10 @@
my ($status, $msg) = $unpriv->_AddMember( InsideTransaction => 1, PrincipalId => $principal);
if ($status) {
+ $self->_NewTransaction(
-+ Type => 'Set',
-+ Field => 'Privileged',
-+ NewValue => 0,
-+ OldValue => 1,
++ Type => 'Set',
++ Field => 'Privileged',
++ NewValue => 0,
++ OldValue => 1,
+ );
return (1, $self->loc("That user is now unprivileged"));
} else {
2: a6d5c87 ! 2: bd44290 log transactions when adding/removing a User/Group to a Group
@@ -15,13 +15,13 @@
+ # Record transactions for UserDefined groups
+ if ($args{RecordTransaction} && $self->Domain eq 'UserDefined') {
+ $new_member_obj->Object->_NewTransaction(
-+ Type => 'AddMembership',
-+ Field => $self->PrincipalObj->id,
++ Type => 'AddMembership',
++ Field => $self->PrincipalObj->id,
+ );
+
+ $self->_NewTransaction(
-+ Type => 'AddMember',
-+ Field => $new_member,
++ Type => 'AddMember',
++ Field => $new_member,
+ );
+ }
+
@@ -35,13 +35,13 @@
+ # Record transactions for UserDefined groups
+ if ($args{RecordTransaction} && $self->Domain eq 'UserDefined') {
+ $member_obj->MemberObj->Object->_NewTransaction(
-+ Type => 'DeleteMembership',
-+ Field => $self->PrincipalObj->id,
++ Type => 'DeleteMembership',
++ Field => $self->PrincipalObj->id,
+ );
+
+ $self->_NewTransaction(
-+ Type => 'DeleteMember',
-+ Field => $member_id,
++ Type => 'DeleteMember',
++ Field => $member_id,
+ );
+ }
+
@@ -62,21 +62,25 @@
+ my $self = shift;
+ my $principal = RT::Principal->new($self->CurrentUser);
+ $principal->Load($self->Field);
-+ my $principal_friendly_name = $principal->IsUser ? 'user' :
-+ $principal->IsGroup ? 'group' : '';
+
-+ return ("Added [_1] '[_2]'",
-+ $principal_friendly_name, $principal->Object->Name); #loc()
++ if ($principal->IsUser) {
++ return ("Added user '[_1]'", $principal->Object->Name); #loc()
++ }
++ else {
++ return ("Added group '[_1]'", $principal->Object->Name); #loc()
++ }
+ },
+ DeleteMember => sub {
+ my $self = shift;
+ my $principal = RT::Principal->new($self->CurrentUser);
+ $principal->Load($self->Field);
-+ my $principal_friendly_name = $principal->IsUser ? 'user' :
-+ $principal->IsGroup ? 'group' : '';
+
-+ return ("Removed [_1] '[_2]'",
-+ $principal_friendly_name, $principal->Object->Name); #loc()
++ if ($principal->IsUser) {
++ return ("Removed user '[_1]'", $principal->Object->Name); #loc()
++ }
++ else {
++ return ("Removed group '[_1]'", $principal->Object->Name); #loc()
++ }
+ },
+ AddMembership => sub {
+ my $self = shift;
3: 7a55383 = 3: f591697 add new Group transactions to RT::Group's __DependsOn
4: a6b642b = 4: 973e702 add new User transactions to RT::User's __DependsOn
5: 33f3d85 < -: ------- update shredder group membership test to dispose of new transactions
-: ------- > 5: c050da1 update shredder group membership test to dispose of new transactions
More information about the rt-commit
mailing list