Changeset 2834

Show
Ignore:
Timestamp:
11/21/08 00:40:07 (7 weeks ago)
Author:
rickc
Message:

Automatically grant permission to the admin group when a new permission is created.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/htdocs/system/classes/acl.php

    r2751 r2834  
    126126            return false; 
    127127        } 
     128 
     129        // Add the permission to the admin group 
     130        $perm = ACL::token_id( $name ); 
     131        $admin = UserGroup::get( 'admin'); 
     132        if( $admin ) { 
     133            ACL::grant_group( $admin->id, $perm ); 
     134        } 
     135 
    128136        EventLog::log('New permission created: ' . $name, 'info', 'default', 'habari'); 
    129137        Plugins::act('permission_create_after', $name, $description );