[Rt-commit] rt branch, 4.4/disabled-articles, repushed
? sunnavy
sunnavy at bestpractical.com
Tue Nov 25 11:01:36 EST 2014
The branch 4.4/disabled-articles was deleted and repushed:
was b58bac6baf9166d830d810391b5e259727bbe9a8
now 500329f55d70fd1bf89d8dda259f71da2aa88546
1: b58bac6 ! 1: 500329f don't delete articles, just disable them.
@@ -142,9 +142,7 @@
- return ( 0, $self->loc('Internal Error') );
- }
- }
-+ return $self->SetDisabled(1);
-+}
-
+-
- while ( my $item = $cfvalues->Next ) {
- my ( $val, $msg ) = $item->Delete();
- unless ($val) {
@@ -153,8 +151,7 @@
- return ( 0, $self->loc('Internal Error') );
- }
- }
-+# }}}
-
+-
- while ( my $item = $topics->Next ) {
- my ( $val, $msg ) = $item->Delete();
- unless ($val) {
@@ -162,24 +159,34 @@
- $RT::Handle->Rollback();
- return ( 0, $self->loc('Internal Error') );
- }
-+sub SetDisabled {
-+ my $self = shift;
-+ unless ( $self->CurrentUserHasRight('DisableArticle') ) {
-+ return ( 0, $self->loc("Permission Denied") );
- }
+- }
-
- $self->SUPER::Delete();
- $RT::Handle->Commit();
- return ( 1, $self->loc('Article Deleted') );
-
-+ return $self->SUPER::SetDisabled(@_);
++ return $self->SetDisabled(1);
}
--# }}}
--
- # {{{ Children
-
- =head2 Children
+ # }}}
+@@
+ @_
+ );
+
+- unless ( $self->CurrentUserHasRight('ModifyArticle') ) {
+- return ( 0, $self->loc("Permission Denied") );
++ if ( $args{Field} eq 'Disabled' ) {
++ unless ( $self->CurrentUserHasRight( 'DisableArticle' ) ) {
++ return ( 0, $self->loc( "Permission Denied" ) );
++ }
++ }
++ else {
++ unless ( $self->CurrentUserHasRight( 'ModifyArticle' ) ) {
++ return ( 0, $self->loc( "Permission Denied" ) );
++ }
+ }
+
+ $self->_NewTransaction(
@@
=cut
More information about the rt-commit
mailing list