outflux3 / SettingsFactory

Create unlimited settings pages for ProcessWire CMS
GNU General Public License v2.0
14 stars 4 forks source link

Remove link to edit Process for non-superusers #4

Closed adrianbj closed 4 years ago

adrianbj commented 4 years ago

Hi @outflux3 - what do you think above removing this for non-superusers? Just because a user has access to the settings page, doesn't mean they should be able to edit the Process page - and of course PW won't actually let them edit that page which makes the link even more confusing for them.

image

Thanks!

outflux3 commented 4 years ago

sure, so i just made the change like this:

$out = $form->render() . "<p class='version detail'><i class='fa fa-check-square-o'></i> Settings Factory v$moduleInfo[versionStr] | $filepath"; if($this->wire->user->isSuperuser()) $out .= " | <a href='{$this->wire('page')->editUrl}' target='_blank'>Edit Process Settings</a>"; $out .= '</p>';

and need to test it before committing to repo, but should be able to do that soon.

outflux3 commented 4 years ago

or should i just remove the whole line for non-superusers...

adrianbj commented 4 years ago

Honestly I think the entire line should probably be removed - it's irrelevant for non-superusers.

Thanks!

outflux3 commented 4 years ago

Should be resolved now: https://github.com/outflux3/SettingsFactory/blob/affa7d0154fe75914b254958afc49747c55ad430/ProcessSettingsFactory.module#L52

adrianbj commented 4 years ago

Thanks - that's much better!