Jump to content

Editing Template Access via API


thomas
 Share

Recommended Posts

Short question: Is it possible?

Longer explanation: I have a rather big product cataloque which is viewable for registered users only. We now want to open it to the public. In the valued spirit of "I'd rather take 30 minutes to script something than 20 minutes to do it manually" I am looking for a way to change the access of 50 or so templates to "viewable for guest" but I can't find an API method. Can anyone help?

Thanks,

thomas

Link to comment
Share on other sites

Short answer: Yes

Attached is a revised version of the module I posted here: https://processwire.com/talk/topic/8406-set-multiple-templates-role-access/?p=81711

This new version adds support for changing "View" access and includes the Guest role (the original version didn't have these options). I haven't tested all scenarios thoroughly with this new version, but hopefully it works as expected.

Once installed, go to Setup > Template Setup Batcher

PS Don't forget the SHIFT+Click trick for selecting all 50 templates.

ProcessTemplateSetupBatcher.module

  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...

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...