Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No permissions admin notice #414

Closed
GaryJones opened this issue May 18, 2015 · 6 comments
Closed

No permissions admin notice #414

GaryJones opened this issue May 18, 2015 · 6 comments

Comments

@GaryJones
Copy link
Member

On logging in to another site where I'm not an administrator, I saw:

screenshot 2015-05-18 22 18 30

While it's obviously good that a normal user can't install plugins, I don't think this message serves any purpose in being shown at all. As a user, I should not need to know what plugins a site should be running. Let's hide the message altogether and remove the associated strings that are currently being shown, and return early from any admin notice functions.

@jrfnl
Copy link
Contributor

jrfnl commented May 20, 2015

That completely depends on the kind of site. For a large multi-user site, I can see your point.
But for the more common - dev = admin, and three or four users which are just below admin, the message is useful. The dev might only be involved at the customers request and not keep up with which plugins need updating and such. Users need to know to contact the dev to get things working properly.

What about if we add a capability-check for which users can see it ? Something like author minimum ?

@GaryJones
Copy link
Member Author

Users need to know to contact the dev to get things working properly.

That's common sense already.

I guess the problem is that the details of which plugins are shown, when the user can't do anything about any plugins. How about author minimum, but also make the text generic like "This site requires one or more plugins that are not installed. Contact the ..."?

@jrfnl
Copy link
Contributor

jrfnl commented May 21, 2015

May be we should also consider to only show the notice if required plugins need to be installed or updated. And not show anything at all to non-admins if the notice would only deal with recommended plugins.

@jrfnl
Copy link
Contributor

jrfnl commented May 21, 2015

And now that updating is in - if the user has dismissed the message before, it would not show for new updates anymore. That kind of feels wrong as well.

Basically I think we may need to rename issue #353 to "Refactor/rethink complete notices logic" and collect all the different bits there.

And we need to think through whether that should be something we still want to do for 2.5. It is already on the roadmap for 3.0

@MickeyKay
Copy link

I'm running into the same issue. My thought is that it would make sense to set the minimum user role or capability for which the notice should be displayed. That'd be a pretty simple fix.

@GaryJones
Copy link
Member Author

Definitely not a 2.5.0 thing. Either add a capability check in 2.6.0, or rewrite completely for 3.0.0

jrfnl added a commit that referenced this issue Jan 5, 2016
By default the following logic will be used:
User < 'publish_posts': no admin notices
User < install/update/activate: "contact administrator notice" without disclosing information about the plugins involved and only if there are *required* plugins which require action.
User = install/update/activate: "normal" notices

The minimum user level for which admin notices are shown at all can be adjusted by using the newly introduced `tgmpa_show_admin_notice_capability` filter. The default is set to 'publish_posts', i.e. Authors.

Example:
add_filter( 'tgmpa_show_admin_notice_capability', create_function( '$cap', 'return \'edit_pages\';' ) );

To only show the admin notices to network admins on multisite, set it to a super admin capability like 'manage_network_plugins'.

Note: the `notices()` function is ugly and in desperate need of refactoring, that is not handled in this PR (which only makes it worse).

Fixes #190, #414
Supersedes: https://github.com/INN/Largo/pull/740/files
Partially fixes #479, #489 - notice will now only show for required updates for non-admin users with level author or editor.
Possibly fixes #492, though more information is needed on the actual case.
jrfnl added a commit that referenced this issue Jan 5, 2016
By default the following logic will be used:
User < `'publish_posts'` (=Author): no admin notices
User < install/update/activate: "contact administrator notice" without disclosing information about the plugins involved and only if there are *required* plugins which require action.
User = install/update/activate: "normal" notices

The minimum user level for which admin notices are shown at all can be adjusted by using the newly introduced `tgmpa_show_admin_notice_capability` filter. The default capability is set to `'publish_posts'`.

Example:
add_filter( 'tgmpa_show_admin_notice_capability', create_function( '$cap', 'return \'edit_pages\';' ) );

Another example:
To only show the admin notices to network admins on multisite, set it to a super admin capability like `'manage_network_plugins'`.

Note: the `notices()` function is ugly and in desperate need of refactoring, that is not handled in this PR (which only makes it worse).

Fixes #190, #414
Supersedes: https://github.com/INN/Largo/pull/740/files
Partially fixes #479, #489 - notice will now only show for required updates for non-admin users with level author or editor.
Possibly fixes #492, though more information is needed on the actual case.
jrfnl added a commit that referenced this issue Jan 5, 2016
By default the following logic will be used:
User < `'publish_posts'` (=Author): no admin notices
User < install/update/activate: "contact administrator notice" without disclosing information about the plugins involved and only if there are *required* plugins which require action.
User = install/update/activate: "normal" notices

The minimum user level for which admin notices are shown at all can be adjusted by using the newly introduced `tgmpa_show_admin_notice_capability` filter. The default capability is set to `'publish_posts'`.

Example:
add_filter( 'tgmpa_show_admin_notice_capability', create_function( '$cap', 'return \'edit_pages\';' ) );

Another example:
To only show the admin notices to network admins on multisite, set it to a super admin capability like `'manage_network_plugins'`.

Note: the `notices()` function is ugly and in desperate need of refactoring, that is not handled in this PR (which only makes it worse).

Fixes #190, #414
Supersedes: https://github.com/INN/Largo/pull/740/files
Partially fixes #479, #489 - notice will now only show for required updates for non-admin users with level author or editor.
Possibly fixes #492, though more information is needed on the actual case.
@jrfnl jrfnl closed this as completed Jan 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants