plugins/gallery/nssetup.php
changeset 0 7caf561c50ee
child 18 c1c398349651
equal deleted inserted replaced
-1:000000000000 0:7caf561c50ee
       
     1 <?php
       
     2 
       
     3 /*
       
     4  * Snapr
       
     5  * Version 0.1 beta 1
       
     6  * Copyright (C) 2007 Dan Fuhry
       
     7  *
       
     8  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
       
     9  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
       
    10  *
       
    11  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
       
    12  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
       
    13  */
       
    14 
       
    15 $plugins->attachHook('acl_rule_init', 'gallery_setup_namespace($this);');
       
    16 
       
    17 function gallery_setup_namespace(&$paths)
       
    18 {
       
    19   global $db, $session, $paths, $template, $plugins; // Common objects
       
    20   
       
    21   $paths->create_namespace('Gallery', 'Image:');
       
    22   
       
    23   $session->register_acl_type('gal_full_res', AUTH_ALLOW, 'View image at full resolution', array('read'), 'Gallery');
       
    24   
       
    25   $session->acl_extend_scope('read',                   'Gallery', $paths);
       
    26   $session->acl_extend_scope('post_comments',          'Gallery', $paths);
       
    27   $session->acl_extend_scope('edit_comments',          'Gallery', $paths);
       
    28   $session->acl_extend_scope('mod_comments',           'Gallery', $paths);
       
    29 }
       
    30 
       
    31 ?>