Tweak: maybe add the same capability check (manage_settings) also for js as menu icon #72
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes
the module does this two calls:
the menu icon is showed if:
current_user_can( 'manage_options' )
&& is_admin()
&& $this->container->get( 'capabilities' )->get( 'canAccessHelpCenter' )
while the css and js are loaded if:
file_exists( $asset_file )
&& $this->container->get( 'capabilities' )->get( 'canAccessHelpCenter' )
so what happens is that if I have a contributor role and access the admin dashboard, I do not see the help center icon in topbar as I do not have the manage_options but the css and js are still loaded - I think we should avoid this but I am not sure the js is loaded to make the functions available to a third part thing
Type of Change
Production
If you login as contributor for example, you will not see the help centr menu icon in topbar but the scripts are still loaded
Development
Video
Checklist
Further comments