DrQuincy Posted 3 hours ago Posted 3 hours ago In a template you can enable: Prevent direct access to file assets owned by pages using this template? And in site/assets the folder of that page has a minus prefix added so Apache tells PW to handle the file request. I have a situation where I want the top level page to have no access control but I also have a series of files where I need access control. I.e. it's a mix. I'm just wondering if I make the files be part of a repeater, can I set access control for the repeater only since it has its own ID. Will this work? I would guess that it does but I wanted to see if anyone has used this approach in production.
monollonom Posted 15 minutes ago Posted 15 minutes ago 2 hours ago, DrQuincy said: I'm just wondering if I make the files be part of a repeater, can I set access control for the repeater only since it has its own ID. Will this work? Funnily I tried exactly this yesterday and no unfortunately it doesn’t work because the repeater will check the access control of the page holding it. However it could a request to add a line to check if its access control is on, something like: public function getAccessTemplate($type = 'view') { if($this->template->useRoles) return $this->template; $p = $this->getForPageRoot(); return $p->id ? $p->getAccessTemplate($type) : parent::getAccessTemplate($type); } I tried and it worked but it wasn’t a fit in the end for what I was trying to achieve.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now