I've written some code to handle an iframe showing an alttemplate of a child page with a single pagefield on there (couldn't word that better, sorry.), the template is protected.
While I was building I noticed that general code wasn't effected by the public access permissions, the following code would output everything but the pagefield
I was under the impression that, if you write a macro to handle something that has restricted public access, then you can still output it to those that don't have access, so I made the simplest macro known to man as a work around which was as follows
@Model.moduleDescription
I tried this, and still got nothing but the TESTTEXT
I've created macros that take pagefields from restricted parents and output them on the current page before and had no trouble, I know this is slightly different, but what am I missing?
I assume you don't load the complete page in the IFrame but have a page that get's that displays properties via Razor? In case of the last you need to check first if the user has Access to the node
node.HasAccess()
Protecting pages will protect access to the whole page not the properties.
Public access permissions and Razor Macros
Hi Guys,
I'm using 4.9.0
I've written some code to handle an iframe showing an alttemplate of a child page with a single pagefield on there (couldn't word that better, sorry.), the template is protected.
While I was building I noticed that general code wasn't effected by the public access permissions, the following code would output everything but the pagefield
As shown here
TESTTEXT
I was under the impression that, if you write a macro to handle something that has restricted public access, then you can still output it to those that don't have access, so I made the simplest macro known to man as a work around which was as follows
I tried this, and still got nothing but the TESTTEXT
I've created macros that take pagefields from restricted parents and output them on the current page before and had no trouble, I know this is slightly different, but what am I missing?
Thanks
Jordan
Hi Jordan
What does the actual Razor code look like?
/Jan
Hi,
I assume you don't load the complete page in the IFrame but have a page that get's that displays properties via Razor? In case of the last you need to check first if the user has Access to the node
Protecting pages will protect access to the whole page not the properties.
Hope this helps,
Richard
is working on a reply...