• Hi ! I’m trying to let a customized user see the nextgen gallery menus.

    This is the code that creates the user:

    add_role('customer', 'Customer', array(
                    'read' => true
                    (etc)
            ));

    Then I tryed with this for Nextgen Gallery menus:

    add_role('customer', 'Customer', array(
    'general' => true,
    'tinymce' => true,
    'add_gallery' => true,
    'ngg_manage_gallery' => true,
    'manage_others' => true,
    'manage_tags' => true,
    'edit_album' => true,
    'change_style' => true,
    'change_options' => true
            ));

    But it’s not working. I also tryed:

    $role = get_role( 'customer' );
    $role->add_cap( 'general' );

    Can you help me ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter ELAN42///

    (@nokao)

    Looking at NextGen Gallery code (admin.php file) I found this name in the add_menu calls, but they don’t work:

    add_role('customer', 'Customer', array(
    'nggallery' => true,
    'nggallery-add-gallery' => true,
    'nggallery-manage-gallery' => true,
    'nggallery-manage-album' => true,
    'nggallery-tags' => true,
    'nggallery-options' => true,
    'nggallery-style' => true,
    'nggallery-roles' => true,
    'nggallery-about' => true,
    'nggallery-setup' => true
            ));

    Thread Starter ELAN42///

    (@nokao)

    I found a solution !!! This seems a bug to me, the menu pages are registered with their names, not with the slug. So this is the solution:

    add_role('customer', 'Customer', array(
    'NextGEN Gallery overview' => true,
    'NextGEN Upload images' => true,
    'NextGEN Manage gallery' => true,
    'NextGEN Edit album' => true,
    'NextGEN Manage tags' => true,
    'NextGEN Change options' => true,
    'NextGEN Change style' => true
    ));

    It’s still not clear how to give the “manage_others” role. Actually this user can’t edit other’s galleries.

    Can some developer answer please ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: NextGEN Gallery] Roles Hardcode (with custom roles)’ is closed to new replies.