Changeset 486


Ignore:
Timestamp:
10/04/09 17:10:11 (15 years ago)
Author:
nanardon
Message:
  • fix warning
File:
1 edited

Legend:

Unmodified
Added
Removed
  • LATMOS-Accounts/lib/LATMOS/Accounts/Bases.pm

    r477 r486  
    226226sub create_c_object { 
    227227    my ($self, $otype, $id, %cdata) = @_; 
     228    $self->check_acl($otype, '@CREATE', 'w') or do { 
     229        $self->log(LA_WARN, 'permission denied to create object type %s', 
     230            $otype); 
     231        return; 
     232    }; 
     233    $self->_create_c_object($otype, $id, %cdata); 
     234} 
     235 
     236sub _create_c_object { 
     237    my ($self, $otype, $id, %cdata) = @_; 
    228238 
    229239    # populating default value 
     
    258268 
    259269sub delete_object { 
     270    my ($self, $otype, $id) = @_; 
     271    my $obj = $self->get_object($otype, $id) or do { 
     272        $self->log(LA_WARN, 'Cannot delete %s/%s: no such object', 
     273            $otype, $id); 
     274        return; 
     275    }; 
     276    $self->check_acl($obj, '@DELETE', 'w') or do { 
     277        $self->log(LA_WARN, 'permission denied to delete %s/%s', 
     278            $otype, $id); 
     279        return; 
     280    }; 
     281    $self->_delete_object($otype, $id); 
     282} 
     283 
     284sub _delete_object { 
    260285    my ($self, $otype, $id) = @_; 
    261286    my $pclass = $self->_load_obj_class($otype); 
     
    384409        } 
    385410    } elsif(!$options{nocreate}) { 
    386         if ($self->create_c_object($srcobj->type, $srcobj->id, %data)) { 
     411        if ($self->_create_c_object($srcobj->type, $srcobj->id, %data)) { 
    387412            return 'CREATE' 
    388413        } else { 
Note: See TracChangeset for help on using the changeset viewer.