Ignore:
Timestamp:
04/20/17 18:30:01 (7 years ago)
Author:
nanardon
Message:

Add function: is user allow to create object

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Model/Accounts.pm

    r1334 r1986  
    120120} 
    121121 
     122sub CanCreateObjects { 
     123    my ($self, @otype) = @_; 
     124 
     125    my $db = $self->db; 
     126 
     127    if (!@otype) { 
     128        @otype = $db->list_supported_objects; 
     129    } 
     130 
     131    foreach (@otype) { 
     132        if (!$db->check_acl($_, '@CREATE', 'w')) { 
     133            return; 
     134        } 
     135    } 
     136    return 1; 
     137} 
     138 
    122139# Such function must not be here, but in LATMOS::Accounts 
    123140# But code does not allow this at time 
Note: See TracChangeset for help on using the changeset viewer.