Post settings permission

Posted in: Newspaper
Post count: 105

By default, subscribers and collaborators do not have access to the post settings block that allows them to set sources or via options.

I would like to grant them this possibility by default (if possible, only Post template, sources and via).

What permission do I need to add to this roles?

Post count: 20688

Hi,

They do not have access according to the rules mentioned here
– https://codex.wordpress.org/Roles_and_Capabilities and that the theme is using.
Only authors have access to the post templates, not contributors or users. The contributor can create a post and submit it for review, while a subscriber can only read posts, according to the documentation. You could change this rule, for these roles by modifying this file in the theme – https://www.screencast.com/t/4vU4KLQJjevV that allows this access only to author roles or above in the hierarchy. Change it based on the capabilities of contributors or subscribers
– https://www.screencast.com/t/YubCZgmXMry
This will make the post templates and the fields you want available to these roles.
Example – https://www.screencast.com/t/pzLDu8nc (all roles from subscriber and above have access)

Thanks

Post count: 105

Hi Simion,

Thanks for your answer. I was asking about the name of the capability so I can add it myself to those roles. I changed their behavior anyway, I just couldn’t find the name of the capability that those roles should have (the official Wordpres page doesn’t mention any templating capability).

Something like can_use_templates so I can add it like


function subscriber_xxx() {
$subscriber = get_role('subscriber');
$subscriber->add_cap('can_use_templates');
}

add_action('admin_init', 'subscriber_xxx');

  • This reply was modified 9 years by Erythros.
Post count: 20688

Hi,

These roles were created with a reason I believe, so there can be some distinction and different permissions depending on an assigned role . If a subscriber should have the capability of an author, then there would be no point to have a subscriber. There are plugins that can be useful to change the user roles and permissions, if you should consider using one.

Thanks

Post count: 105

One more question: I am trying to override the line you mentioned baove in content-metaboxes.php, but I tried using the child theme. It didn’t work, but I am not sure if I should keep in the child theme folder the same file structure (includes/wp_booster…) or duplicate the file and add it to the root of the child theme folder?

The change is working, but i am trying to avoid losing the changes I make after an update. For some reason, for this file I cannot override the functionality with the child theme.

Post count: 20688

Hi,

You will have to make this modification directly to the core theme file. These are the only files that can be used through a child theme at the moment – https://forum.tagdiv.com/the-child-theme-support-tutorial/
Or as I mentioned above, search for a plugin that can manage this and not make any modifications at all to the theme files.

Thanks

Post count: 105

Well, I kinda changed the way the regular users work. Authors don’t have the rights to publish articles anymore therefore they can’t see the post templates as well.
For now, I changed the core files so that I works ok edit_published_posts, but I’ll need a more permanent solution.
The subscriber role was also altered to play the role of a proofreader….

Post count: 105

With Newspaper 8 this functionality is gone.
I am using child theme (provided by you) and until v8 everything was working as expected. It stopped working after the update.

I replaced the file in the child, i even tried making the change directly in the core.

Anything changed?

Post count: 20688

Hi,

The user role capabilities did not change. These are still the default roles like before. The file where this is defined is still the same in this regard
– https://www.screencast.com/t/GZJmglW8jWj
Like I mentioned before, maybe it would be easier to use a plugin to customize the user capabilities the way you want.

Thanks

Viewing 9 posts - 1 through 9 (of 9 total)
The forum ‘Newspaper’ is closed to new topics and replies.