When assigning public access on a node you are asked to give a login page and an error page. I've been asked by a client if these values can be hardcoded into his umbraco installation.
I know how to set these values in controls that I build - using ProtectPage, but have never tried to mess with anything "core" before. Is there a config setting I can use to set them across an entire umbraco site?
I suppose you could do it with an event handler. But is it really so difficult to select the login and error pages when activating the public access? Remember that you only need to set it on the top-most protected item and all its sub-pages will also be protected. Depending on your content tree structure you could make your work easier or harder... maybe you could re-organize your content to simplify things?
Hehe, I agree. If it were up to me I'd tell them to put up and shut up. Unfortunately the content tree structure requires all these pages to be at the same level, as in taxonimic terms they don't really group together properly. I think you're right though, in most situations I'd try to reshuffle them a bit.
I'll look into the event handler idea though, thanks for your help!
Hardcoding public access properties of nodes
Hi.
When assigning public access on a node you are asked to give a login page and an error page. I've been asked by a client if these values can be hardcoded into his umbraco installation.
I know how to set these values in controls that I build - using ProtectPage, but have never tried to mess with anything "core" before. Is there a config setting I can use to set them across an entire umbraco site?
Many thanks.
I suppose you could do it with an event handler. But is it really so difficult to select the login and error pages when activating the public access? Remember that you only need to set it on the top-most protected item and all its sub-pages will also be protected. Depending on your content tree structure you could make your work easier or harder... maybe you could re-organize your content to simplify things?
cheers,
doug.
Hehe, I agree. If it were up to me I'd tell them to put up and shut up. Unfortunately the content tree structure requires all these pages to be at the same level, as in taxonimic terms they don't really group together properly. I think you're right though, in most situations I'd try to reshuffle them a bit.
I'll look into the event handler idea though, thanks for your help!
hi Shaun
Did you come up with a solution ? cause I've the same problem and I was wondering whether the event handler solution is easy?
cheers
pierre
Hi,
I just had to do something similar. I posted my solution here
http://our.umbraco.org/forum/developers/api-questions/7217-Programitically-setting-public-access-to-a-document
is working on a reply...