- Timestamp:
- 01/22/12 19:38:41 (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WorkflowPlugin/lib/Foswiki/Plugins/WorkflowPlugin/ControlledTopic.pm
r13770 r13783 183 183 # Some day we may handle the can... functions indepedently. For now, 184 184 # they all check editability thus.... 185 sub isModifyable { 186 my $this = shift; 185 sub _isModifiable { 186 my ($this) = @_; 187 my $meta = $this->{meta}; 187 188 188 189 return $this->{isEditable} if defined $this->{isEditable}; 189 190 190 191 # See if the workflow allows an edit 191 unless ( defined $this->{isEditable} ) { 192 $this->{isEditable} = ( 193 $this->isLatestRev() 194 195 # Does the workflow permit editing? 196 && $this->{workflow}->allowEdit($this) 197 198 # Does Foswiki permit editing? 199 # DO NOT PASS $this->{meta}, because of Item11461 200 && Foswiki::Func::checkAccessPermission( 201 'CHANGE', $Foswiki::Plugins::SESSION->{user}, 202 $this->{text}, $this->{topic}, 203 $this->{web} 204 ) 205 ) ? 1 : 0; 206 } 192 # is the latest rev (or no rev) loaded? 193 $this->{isEditable} = $this->isLatestRev(); 194 #print STDERR "Modify denied by isLatestRev\n" unless $this->{isEditable}; 195 196 # Does the workflow permit editing? 197 if ($this->{isEditable}) { 198 $this->{isEditable} = $this->{workflow}->allowEdit($this); 199 #print STDERR "Modify denied by allowEdit\n" unless $this->{isEditable}; 200 } 201 # Does Foswiki permit editing? 202 if ($this->{isEditable}) { 203 # DO NOT PASS $this->{meta}, because of Item11461 204 $this->{isEditable} = Foswiki::Func::checkAccessPermission( 205 'CHANGE', $Foswiki::Plugins::SESSION->{user}, 206 $this->{text}, $this->{topic}, 207 $this->{web} ) if $this->{isEditable}; 208 #print STDERR "Modify denied by checkAccessPermission\n" unless $this->{isEditable}; 209 } 210 $this->{isEditable} ||= 0; # ensure defined 211 207 212 return $this->{isEditable}; 208 213 } … … 211 216 sub canEdit { 212 217 my $this = shift; 213 return $this->isModifyable($this); 218 return $this->_isModifiable(); 219 } 220 221 # Return tue if this topic is editable 222 sub canSave { 223 my $this = shift; 224 return $this->_isModifiable(); 214 225 } 215 226 … … 217 228 sub canAttach { 218 229 my $this = shift; 219 return $this-> isModifyable($this);230 return $this->_isModifiable(); 220 231 } 221 232 … … 223 234 sub canFork { 224 235 my $this = shift; 225 return $this-> isModifyable($this);236 return $this->_isModifiable(); 226 237 } 227 238
Note: See TracChangeset
for help on using the changeset viewer.
