Custom User Permissions
This similar topic has been closed to replies: http://wordpress.org/support/topic/plugin-google-analytics-dashboard-user-roles-to-see-dashboard
However, I’m sure this is still an issue and I’ve found a solution.
To further edit the user roles that the Google Analytics Dashboard widget displays for, you need to edit the
gad-admin-options-ui.phpplugin file at line 122. That is the admin option input for user roles:
<select name="ga_display_level" id="ga_display_level"> <option value="">None - Admin only</option> <option value="level_7" <?php echo ($ga_display_level == 'level_7') ? 'selected' : ''; ?>>Editor</option> <option value="level_2" <?php echo ($ga_display_level == 'level_2') ? 'selected' : ''; ?>>Author</option> <option value="level_1" <?php echo ($ga_display_level == 'level_1') ? 'selected' : ''; ?>>Contributor</option> <option value="level_0" <?php echo ($ga_display_level == 'edit_theme_options') ? 'selected' : ''; ?>>Edit Theme Options</option> </select>
The plugin uses the depreciated user level model, but as you see here you can add/edit required capabilities just as I added the ‘Edit Theme Options’ capability. I haven’t tested this with user roles; however, it should work just fine.
Editing plugin files isn’t a good way to go about this, but it should be easy your the plugin author to add a custom text input to take in custom privileges if needed. As WordPress grows as a CMS, users/devs will be using some kind of custom roles or capabilities more frequently.
- The topic ‘Custom User Permissions’ is closed to new replies.