Change template to require auth

I understand that some pages in plone require authentication and some don't. I would like to add auth to a page by editing the .pt file. Is this possible? If so, how? Can someone please point me to any docs on this?

wrong question, IMO; what are you trying to achieve?

1 Like

You do not configure security inside a template.
A template is usually asociated with a browser view and the browser view has a permission directive inside the related ZCML file...this is where you configure the desired permission. User grant according to their local and gobal roles apply here.

-aj

1 Like

So let's say I have a template, how do I assign that to a browser view? and how do I change the permissions on that browser view?

is the other way around: you create a view and you assign a template to it, and you assign permissions to that view in the ZCML registration; check the relevant documentation:

https://docs.plone.org/develop/plone/views/browserviews.html

1 Like

So I changed the permissions in the configure.zcml from "zope.Public" to "zope.View" and ran buildout. Yet it is not taking effect. Am I missing a step?

Also... links under https://docs.plone.org/develop/plone/security/permission_lists.html#id3 are broken.

I'm not sure what Zope.Public was for, but I think Zope.View on the template doesn't have much of an effect unless the content item it's operating on has had its security changed, e.g. made private.

Thanks. For future reference, you can file bugs like that here

if you want all authenticated users to view the template you can use permission="cmf.SetOwnProperties"