WordPress.org

Ready to get started?Download WordPress

Forums

Cool Video Gallery
[resolved] Roles and permissions (4 posts)

  1. mouli
    Member
    Posted 3 years ago #

    Hi
    I searched high and low for a plugin to do what this does so many thanks to the creator.
    However I need users with the role of Editor to be able to manage galleries etc.
    Currently, if I log in as an editor I get no menu item in the side bar but the dashboard summary panel is visible.
    If I click on either of the links to manage galleries or upload videos I get the "You do not have sufficient permissions to access this page." error.

    Is there a way to allow Editors to manage Cool Video Galleries?

    Many thanks for your time.

  2. mouli
    Member
    Posted 3 years ago #

    I solved it myself by editing the admin_menu() function in cool-video-gallery.php to allow access to some menu items to users with the capability of "moderate_comments" which includes Admin and Editors.

    It seems to work fine now so I hope this post saves somebody some time

  3. Loncey Craig
    Member
    Posted 2 years ago #

    Hey Mouli,
    So how did you type it out in the admin_menu() function please?

    Loncey

  4. mouli
    Member
    Posted 2 years ago #

    Apologies... selfish of me not to share...

    add_menu_page('Video Gallery Overview', __('Video Gallery'), 'moderate_comments', 'cvg-gallery-overview' , array(&$this, 'gallery_overview'), $this->plugin_url .'/images/video_small.png');
    			add_submenu_page( 'cvg-gallery-overview', __('Video Gallery Overview'), 'Overview', 'moderate_comments', 'cvg-gallery-overview',array(&$this, 'gallery_overview'));
    			add_submenu_page( 'cvg-gallery-overview', __('Add Gallery / Upload Videos'), 'Add Gallery / Videos', 'moderate_comments', 'cvg-gallery-add',array(&$this, 'gallery_add'));
    			add_submenu_page( 'cvg-gallery-overview', __('Manage Video Gallery'), 'Manage Gallery', 'moderate_comments', 'cvg-gallery-manage',array(&$this, 'gallery_manage'));
    			add_submenu_page( 'cvg-gallery-overview', __('Gallery Details'), 'Gallery Details', 'moderate_comments', 'cvg-gallery-details',array(&$this, 'gallery_details'));
    			add_submenu_page( 'cvg-gallery-overview', __('Gallery Sort'), 'Gallery Sort', 'moderate_comments', 'cvg-gallery-sort',array(&$this, 'gallery_sort'));
    			add_submenu_page( 'cvg-gallery-overview', __('Gallery Settings'), 'Gallery Settings', 'manage_options', 'cvg-gallery-settings',array(&$this, 'gallery_settings'));
    			add_submenu_page( 'cvg-gallery-overview', __('Video Player Settings'), 'Video Player Settings', 'manage_options', 'cvg-player-settings',array(&$this, 'player_settings'));
    			add_submenu_page( 'cvg-gallery-overview', __('CVG Google XML Video Sitemap'), 'Google XML Video Sitemap', 'manage_options', 'cvg-video-sitemap',array(&$this, 'video_sitemap'));
    			add_submenu_page( 'cvg-gallery-overview', __('CVG Uninstall'), 'Uninstall CVG', 'manage_options', 'cvg-plugin-uninstall',array(&$this, 'uninstall_plugin'));

    The add_menu_page item shows the menu in the side bar and the add_submenu_page items apply to individual menu items.

    You can define which menu item appear for any role by defining the capability.
    For example manage_options is only for admin users, and moderate_comments allows editors to use the menu item.

    Mouli

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic