• Hi, I made some test with the new roles-capabilities of NestGEN Gallery, but, it only support the “edit or add links” on the Gallery Dashboard.

    If “any” user with permission to edit his own gallery wants to edit “any” gallery, he only have to go to the url:

    wp-admin/admin.php?page=nggallery-manage-gallery&mode=edit&gid=XX

    where “XX” is the gallery owned by other user or admin.

    The role-capabilities feature just print or not print the “edit link”, but not prevent gallery edition from users with no permissions.

    (ps. sorry for my poor english)

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter pepe-montfort

    (@pepe-montfort)

    Hi, I tried to solve this with some additons to admin/functions.php admin/manage.php and admin/manage-images.php

    Well, in my case, I just want the User_ID #1 (admin) can edit or delete galleries or pictures, and other user with permissions sets on the role-capabilities of nextgen-gallery can create and upload pictures to their own galleries.

    In admin/functions.php I add this code inside swfupload_image, upload_images and import_zipfile functions (adding global $user_ID where needed):

    if($galleryID != '0') {
    $elautor = $wpdb->get_var("SELECT author FROM $wpdb->nggallery WHERE gid = '$galleryID' ");
    if($user_ID != $elautor){
    if($user_ID != 1){
    nggGallery::show_error( __('No puedes subir archivos a esta galería. No tienes permisos suficientes.', 'nggallery') );
    return;
    }
    }
    }

    In manage.php file I add this code for the “If” $this->mode ‘delpic’, ‘delete’ and ‘bulkaction’, in the “processor” function.

    $elautor = $wpdb->get_var("SELECT author FROM $wpdb->nggallery WHERE gid = '$this->gid' ");
    if($user_ID == 1) {  
    
    // ... the code for $this->mode delpic, delete or bulkaction
    
    }	else { nggGallery::show_message( __('No tiene permisos suficientes para ejecutar esta acción',"nggallery") ); $this->mode = 'main'; }

    And manage-images… well, more code too…

    It is not clean, but it works for me. Hope I can help more.

    Thanks for the note, I’ve changed that

    Check this fix : http://code.google.com/p/nextgen-gallery/source/detail?r=494

    Duke

    (@dukessa)

    I have a problem with roles.

    Im using the plugin Role Manager, and I made a new user and role and assigned ALL NextGen permissions for it, and also editing pages.

    From the new user, I can see the Gallery menu on the left, and I can edit all the settings, photos..etc.
    But when I want to add a gallery to a page, and I click on the editor button for the little gallery selection window, I get a message in the window that says “you are not authorized to access this”.

    I checked and in Role Manager the Tiny MCE Editor button permission is ok.

    Maybe a bug?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: NextGEN Gallery] Role-Capabilities not working fine’ is closed to new replies.