View Admin As

Description

The ultimate User switcher and Role manager

This plugin will add a menu item to your admin bar where you can change your view in the WordPress admin without the need to login with a user that has this role!

If you’ve selected a user, you can also change this user’s preferences; like screen settings on various admin pages. You can also switch to a role or temporarily change your own capabilities.

With the “Role defaults” module you can set default screen settings for roles and apply them on users through various bulk actions.

It also features a “Role manager” module to add, edit or remove roles and grant or deny them capabilities.

Overview / Features

  • Switch between user accounts
    • Edit this user’s screen preferences and settings
  • Switch between roles
  • Temporarily change your own capabilities (non-destructively)
  • View your site as an unregistered visitor
  • Switch language/locale on backend and frontend
  • Easily switch back anytime
  • Completely secure (see Security below)
  • Do all the above without logging out!

Module: Role defaults (screen settings)

  • Set default screen settings for roles
  • Apply defaults to a user
  • Apply defaults to all users of a role
  • Apply defaults when registering a new user (in a multisite this is done when a user is added to its first blog)
  • Copy defaults from one role to another (or multiple)
  • Import/Export role defaults, can also download (and upload) setting files
  • Disable the “screen settings” option and/or lock the meta boxes for all users that don’t have access to this plugin

Module: Role manager (role editor)

Note: Changes made with the Role Manager are permanent!

  • Add, edit or delete roles
  • Grant and/or add capabilities to roles
  • Rename roles
  • Clone roles
  • Import/Export roles, can also download (and upload) setting files
  • Update role capabilities from current view
  • Automatically migrate users to another role after deleting a role

Compatibility & Integrations

This plugin will work with most other plugins but these are tested:

  • Advanced Access Manager (Pro version not verified)
  • bbPress
  • BuddyPress
  • Genesis Framework (and probably other theme frameworks)
  • Gravity Forms
  • Groups 2.1+ (Custom integration: adds a view type for groups. Pro version not tested)
  • Pods Framework 2.0+
  • Members
  • Restrict User Access 0.13+ (Custom integration: adds a view type for access levels)
  • User Roles and Capabilities
  • User Role Editor (Pro version not verified)
  • User Switching (Not sure why you’d want this but yes, switch-ception is possible!)
  • WPFront User Role Editor
  • WP Admin UI Customize 1.5.11+
  • Yoast SEO

Full list of tested plugins and details: Compatibility & Integrations

I can’t switch back!

See item 3 at FAQ.

It’s not working! / I found a bug!

Please let me know through the support and add a plugins and themes list! 🙂

Security

This plugin is completely safe and will keep your users, passwords and data secure.
For more info see item 7 at FAQ!

Developer notes

This plugin will only be useful for admins (network super admins or regular admins). It will not add functionalities for other roles unless you specifically apply custom capabilities for those users.
Also keep in mind that switching to users that have equal roles is disabled. (regular admins to regular admins + super admins to super admins)

I’ve created this at first for myself since I’m a developer and often need to see the outcome on roles which my clients use.

So, when you are developing a plugin or theme that does anything with roles or capabilities you can use this plugin to easily check if everything works.
No more hassle of creating test users and constantly logging out and in anymore!

This plugin is also useful to support your clients and/or users. For example; make screen display presets of the edit and overview pages before you let them log in.

You can find me here:

Translations

Please help translating this plugin on translate.wordpress.org!

Actions & Filters

Plugin capabilities

Click here for documentation

Ideas?

Please let me know on GitHub!

Screenshots

  • Default dropdown
  • Dropdown with grouped users
  • Search users
  • Quickly (de)select capabilities
  • Large popup for better overview of capabilities
  • Admin bar when a view is selected + the reset button location
  • Settings window
  • Module Role defaults window (tabs are normally closed)
  • Module Role manager main window (tabs are normally closed)
  • Module Role manager capability window (tabs is normally closed)
  • Access levels taken from the "Restrict User Access" plugin

Installation

Installation of this plugin works like any other plugin out there. Either:

  1. Upload and unpack the zip file to the ‘/wp-content/plugins/’ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress

Or search for “View Admin As” via your plugins menu.

Minimum Requirements

  • WordPress 4.1 or greater (Though I always recommend to update to the latest version!)

Install as a must-use plugin

Move the view-admin-as.php file into the root of your mu-plugins directory, not in the view-admin-as subdirectory.
This is a limitation of WordPress and probably won’t change soon.

Example:
All files dir: /wp-content/mu-plugins/view-admin-as/...
Main file dir: /wp-content/mu-plugins/view-admin-as.php

FAQ

Installation Instructions

Installation of this plugin works like any other plugin out there. Either:

  1. Upload and unpack the zip file to the ‘/wp-content/plugins/’ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress

Or search for “View Admin As” via your plugins menu.

Minimum Requirements

  • WordPress 4.1 or greater (Though I always recommend to update to the latest version!)

Install as a must-use plugin

Move the view-admin-as.php file into the root of your mu-plugins directory, not in the view-admin-as subdirectory.
This is a limitation of WordPress and probably won’t change soon.

Example:
All files dir: /wp-content/mu-plugins/view-admin-as/...
Main file dir: /wp-content/mu-plugins/view-admin-as.php

1. How do I switch to a user, role or visitor?

Just click on the link!
If the amount of users is more than 10 you can find them under their roles or you can search for them.

2. How does the capability system work?

Only the capabilities that are allowed for your user are shown.
You can deselect the capabilities by clicking on them. When you would like to see the results just click the apply button on the upper left.

Please note that as an administrator you don’t have all capabilities marked as enabled by default. This is because WP overrules some capability checks for super admins. This does not happen when you are in a view!

You can also filter the roles by name or select/deselect all capabilities.
Note: When you select/deselect capabilities while you’ve filtered them only the capabilities shown by your filter are affected!

When you disable a capability that prevents you from viewing a screen, you can reset the view, see next item.

3. I can’t switch back!

When a view is selected there is a reset button available on the dropdown.
If you get a 403 page of WordPress you can return with the link that this plugin will add to those pages.
And if even that doesn’t work just add “?reset-view” in the address bar and you’re good to go! This will work on all pages as long as you are logged in.

Example: http://www.your.domain/wp-admin/?reset-view

4. What data is stored for role defaults and how can I change this?

Please see the view_admin_as_role_defaults_meta filter at Wiki: Filters!

The meta manager (since 1.6.3) provides a UI to edit the meta keys.
Please follow these guidelines:

  • %% stands for a wildcard which could be anything.
  • Avoid special characters. Spaces, quotes etc. are forbidden.
  • Default meta keys cannot be removed, only disabled.
5. I can’t find a user!

Could it be that this user is an equal user to your’s? Example: you are both Admins?
If so, these are filtered. Viewing Admins can only be done when you are a Super Admin within a network installation.

Why? To protect your fellow admin! You have no power over equal users..
Unless you are a superior admin… Read more

If this is not the case, please make sure you aren’t overlooking something.
If that is not the case, please contact me! See next item.

6. It’s not working! / I found a bug!

Please let me know through the support and add a plugins and themes list! 🙂

7. Is this plugin safe? Even for production websites?

You have nothing to worry about.
All the plugin functionality is only run if the user is logged in AND is allowed to use this plugin (website admin or custom capabilities).
This plugin will do absolutely nothing if the above requirements are not met.

  • Your view is stored separately so your user will keep the normal roles and capabilities.
  • All settings, views, capabilities, etc. are verified before applied.
  • Passwords are not (and cannot be) revealed.
  • Fully written with the WordPress coding and security standards.
  • Full support for SSL (https).

So basically if your admin users are safe, this plugin will be safe.
Note: if your admin users aren’t safe, this plugin is the last one to worry about 😉

8. Does this plugin work as a must-use plugin (mu-plugin)?

Yes, see Install as a must-use plugin on the Installation tab.

Reviews

Very useful plugin!

The last version is very fast also with a lot of users.

I personal suggest to install this plugin when you have different user role and you want to test the visibility of your website.

Worth its weight in gold plated pixels

If you are building a multsite network with different user capabilities, this plugin is worth its weight in gold plated pixels. It makes moving around the network and seeing what each user level “sees”, and is capable of doing, really easy, and absolutely priceless!

Works great!

Saves time and allows the ability to check all is presented as it should be for your users. Excellent plugin.

Great! Must have for BuddyPress!

LOVE this plugin!!!! It is going in all of my WP sites! Just choose an option from an always access menu and you’re instantly a different user role…and back.

I am creating a BuddyPress site behind a maintenance mode page, so any time I have to log out it is a given hassle. I’m also setting up an LMS site for courses and another for activities/quizzes. Lots of plugins that change front and back ends. This plugin is a life – saves sanity, time, and confusion. Plus I am not familiar with user roles in general just Admin/Subscr – so I never use them, now I can and expand the scope of some projects.

Logout and login is difficult at any time on any site for me, I have to use a separate browser because my passwords etc auto load which I prefer but not when you need to test or view the site without admin. Generally I just skip testing until I’m done with everything because I hate the log in/out/in – which leads to big problems if anything goes wrong and I haven’t been checking along the way. Troubleshooting will be easier too.

BIG THANKS for a great plugin!

Read all 18 reviews

Contributors & Developers

“View Admin As” is open source software. The following people have contributed to this plugin.

Contributors

“View Admin As” has been translated into 6 locales. Thank you to the translators for their contributions.

Translate “View Admin As” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Changelog

1.7.6.1

  • Compatibility: Improve customizer compatibility. #88
  • Compatibility/Fix: Frontend error with Yoast SEO. Yoast SEO #9285

Detailed info: PR on GitHub

1.7.6

  • Feature: Role manager: Option to migrate users to another role after deleting a role. #86
  • Enhancement: Enhance user full access validation for single installations. Not only check for super admin but also the capabilities edit_users and delete_plugins.
  • Enhancement: Add customizer support and a new setting to disable this. #26
  • Enhancement: Compatibility with $_SERVER['ORIG_REQUEST_URI'] for removable query args on front end. #87
  • UI: Support SVG and file icons + Base64 encoded strings.

Detailed info: PR on GitHub

1.7.5

  • Feature: Language switcher. #81
  • Enhancement: Store options network wide instead of per blog/site if network/multisite is enabled.
  • Enhancement: Action links (no-JS) on frontend.
  • Enhancement: Add filter view_admin_as_freeze_locale to overwrite user setting.
  • Fix: JavaScript init on frontend.
  • UI: Various minor enhancements.

Detailed info: PR on GitHub

1.7.4

  • Feature: Role defaults / Role manager: download export data as file + import from file. #73
  • Enhancement: Refresh page instead of redirect to home when switching to a site visitor on the frontend. #76
  • Enhancement: Role Manager: Refresh the page if a role is updated while active in the current view.
  • Enhancement: jQuery selector performance.
  • Compatibility: WP 4.9 capabilities.
  • Compatibility: WP Admin UI Customize admin bar editor. #40 & WAUC/#1 & WAUC/#2
  • Compatibility: Fix issue with Restrict User Access. RUA/#15
  • Compatibility: Fetch all capabilities from Yoast SEO (5.5+).
  • Compatibility: Must-use plugin loader scripts.
  • UI: The almighty View Admin As loader icon.
  • UI: Full opacity when semi-transparent group nodes are opened.
  • UI: Admin page links for Groups and Restrict User Access modules.
  • UI: Resizable checkbox wrappers.

Detailed info: PR on GitHub

1.7.3

  • Feature: Role Manager: Import/Export roles. #51 & PR #62
  • Feature/Enhancement: Option to disable super admin status when a view is active and modifies the current user. #53 & PR #61
  • Enhancement: Role Manager: Show custom capabilities that are not yet stored but used in an active caps view. #70
  • Enhancement: Prevent duplicate names when fetching capabilities from WP objects.
  • Enhancement: Allow this plugin to be installed as a must-use plugin. #71
  • Enhancement: Role Defaults: Enhance meta key comparison.
  • UI: Option tooltips. #67
  • UI: Enhance full popup caps view.
  • Refactoring: Fix base class name.

Detailed info: PR on GitHub

1.7.2

  • Feature: Integration with the “Groups” plugin. Introduces a new view type groups when this plugin is activated. #11
  • Fix: auto max height didn’t work on frontend. #55
  • Fix: Role Manager used boolval() which is only available in PHP 5.5+. #63
  • Fix: view_admin_as_superior_admins filter was not working for single installations. #65
  • Compatibility: Allow other plugins to overwrite our user_has_cap filter by setting it’s priority as first (large negative number). #56. Thanks to @pbiron for the report.
  • Compatibility: Run the user_has_cap filter in your map_meta_cap filter. #56
  • Compatibility: Add new network capabilities (WP 4.8) to the list. #64
  • Enhancement: Automatic JS handling for simple and more advanced options. #60
  • Enhancement: Role defaults: Rename all wildcard to __all__ to prevent a possible conflict with custom roles.
  • Enhancement: Role defaults: Add recording indicator icon to the top level node when a role view is active.
  • Refactoring: Move form logic to separate class and extend it (admin bar)

Detailed info: PR on GitHub & Groups integration PR on GitHub

1.7.1

  • Feature: Module Role Manager: Rename roles. #47
  • Enhancement: Improve fetching available capabilities for a super admin. It now also checks for registered custom post type and taxonomy capabilities and more other plugins.
  • Compatibility: Also use the user_has_cap filter besides map_meta_cap to further improve capability and role view compatibility.
  • UI: Add submenu scrollbar when there are too much users under a role. #49
  • UI: Module Role Manager: Show original role name for reference.
  • Accessibility: Fix tabindex for some nodes that have form elements.
  • Updated: Screenshots.

Detailed info: PR on GitHub

1.7

  • Feature: New module Role manager. Add, edit and/or remove roles and grant or deny them capabilities. #43
  • Feature: Module Role Defaults: Added the option to copy defaults from one role to another (or multiple). #44
  • Enhancement/UI: Enable and Improve responsive styles/a11y. #16
  • Enhancement/UI: Improved the autoHeight calculation (submenu and popup).
  • Enhancement: View combinations now working in code (No UI). #18
  • Enhancement: Major code refactoring for better standards en easier development.
  • Maintenance: Validated compatibility with “Restrict User Access” (RUA) plugin v0.14. #31
  • Compatibility: Tested with WordPress 4.8 (alpha) and requires WordPress 4.1 or higher (was 3.5).
  • Fix: Fixed all major CodeClimate issues. All green now!
  • Updated: Wiki (documentation).
  • Updated/Added: Screenshots & Banners.

Detailed info: PR on GitHub

Older versions

Complete changelog