Jump to content

Setting permission for page redirects


mucdev
 Share

Recommended Posts

Hi! I am new to processwire and really like working with it so far.

For a relaunch project, some editors of our website need the permission to add redirect URLs while migrating the content. I already created a role "site-manager" so only a few team members have access to certain features.

There is also the option to add redirect URLs in the page settings, but it seems to be restricted only to superusers. Does anyone know of a way to grant permission for this option to another user role?

Since this is the first PW-Project I did not dive in too deep with the permissions yet. I also tried to add a "page-edit-redirect"-permission, but I am somehow stuck on what to do with it.

Thanks

Link to comment
Share on other sites

Fields can be configured to have access level per role. If you edit the redirect field, go into the Access tab and enable access control, you can enable the fields you need for certain roles. 

Link to comment
Share on other sites

Welcome to the PW forum @Slideth. As far as I know, adding redirects directly from a page's setting is not a core-feature. Can you find out if this is a module? Or maybe done with a hook (?). If it's a module, you should try to find its own dedicated module support forum and ask there.

But generally speaking, check this redirect-field setting under "access", maybe you can define things right there...

  • Like 1
Link to comment
Share on other sites

Hi & thanks, 

@dragan: I had another look at it and found out that it's the PagePathHistory-Module (https://modules.processwire.com/modules/page-path-history/) which is a core-module (but not installed by default). Once it is installed, the options are available in the settings tab of page as "what other URLs redirect to this page?"

It does not have a dedicated (system-)field.

PagePathHistory.png

Link to comment
Share on other sites

11 hours ago, Slideth said:

I had another look at it and found out that it's the PagePathHistory-Module

This feature is only available to superusers. See the blog post that introduced it: https://processwire.com/blog/posts/processwire-3.0.118-core-updates/#new-redirect-url-management-in-the-page-editor

Quote

Note that it is currently only visible to the Superuser.

If the setting of redirect URLs is just a temporary need while the site is being migrated you could edit the relevant lines of the ProcessPageEdit module. Or copy the module folder to /site/modules/ and make the change there. E.g.

// page path history (previous URLs)
if($superuser || $this->wire('user')->hasRole('editor')) {
	$f = $this->buildFormPrevPaths();
	if($f) $wrapper->add($f);
}

But you wouldn't want to leave this in place long term because it will mean you won't get core fixes or upgrades to ProcessPageEdit.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...