WordPress default roles

Forums: 

Hi,

We have a scenario where we would like WordPress editors to be able to install new libraries / content types.

Looking at your class-h5p-plugin.php line 631

<code>self::map_capability($role, $role_info, 'manage_options', 'manage_h5p_libraries');</code>

I can change that to an editor capabaility to fo this, but don't want to hack the core code.

Any suggestions? Would you be able to add a filter so we devs can return their own set of permissions, or perhaps in the H5P settings allow an option for minimum capability to install new libraries.

The reason is we don't want our editors to have access to themes / plugin changes but we DO trust them to manage their H5P content and unless the content type has already been installed they can't create that item type.

Many thanks,

Alex Furr

 

Summary: 
wordpress modify capability for library installs
otacke's picture

Hi Alex!

All you need to do is to install a WordPress plugin that allows you to manage the capabilities and to set the rights/roles to suit your needs - WordPress doesn't ship with its own role manager, unfortunately.

Best,
Oliver

Hi Oliver,
That seems like overkill to me - I'll create a simple plugin that adds that option as part of the H5P interface as I'm sure it would be useful to others and share when complete.

best wishes,

Alex

otacke's picture

Hi Alex!

I didn't say it was a one-fits-all solution, but it will allow you to set capabilities per role as you like.

Cheers,

Oliver 

Hi Oliver,
If it's any use to anyone else here is a light weight plugin that gets round this issue without installing a user roles plugin.
https://github.com/alexfurr/h5p-role-settings

It also ensures the H5P hub is always active, as we've had problems in the past when it's become inactive for some reason.

Hope it helps someone else...

otacke's picture

Hi Alex!

I think what you wrote is rather a customization script that a plugin. Hope my remarks help:

  • Your "plugin" just performs a couple of operations that would only be required to be done once (unless you think it's smart to set the Hub active over and over again) - and could also be done manually.
  • Your "plugin" doesn't reverse its effects when deinstalling it.
  • The name of the "plugin" is misleading, as "role-settings" sounds like way more than just tweaking the settings to very particular needs (and if they're not, I see no point why the core team woulnd't include those changed to the official repositiory).
  • Setting a role's capability (here editor) based on a capability of any other user of any role seems very weird - especially if checked for again and again.
  • Quite a lot of organizations don't want to use the Hub for privacy concerns (although only non-personal data are transferred). If they used your script and it activated the Hub without any warning, they would surely be pissed.
  • You should consider to follow the WordPress Coding Standards. I know, the H5P plugin doesn't either, but still ...

Cheers,
Oliver