Change object/role permissions w/ python?
Hi all, I have a need to restrict anonymous access to an object until after a specific action occurs. For example, the View permission by default is restricted to owner and manager, but after a 'release' flag is checked, it is viewable to anyone. I can't seem to find a way to do this programatically, after googling for a few hours over the past few weeks. Is it possible? I think the user running the action would need 'change permissions' rights... is there anyway to override that? Thanks again! John
John Toews wrote:
Hi all,
I have a need to restrict anonymous access to an object until after a specific action occurs. For example, the View permission by default is restricted to owner and manager, but after a 'release' flag is checked, it is viewable to anyone. I can't seem to find a way to do this programatically, after googling for a few hours over the past few weeks. Is it possible? I think the user running the action would need 'change permissions' rights... is there anyway to override that?
Thanks again! John
------------------------------------------------------------------------
John, Here's a solution that at best will stimulate a better answer :-) <a href="somePath" tal:condition="python: request.get(releaseFlag,0)">some link </a or <a href="someOtherPath" tal:condition="python: not request.get(releaseFlag,0)">some other link </a> David
On Thu, 5 Jan 2006 19:13:13 -0800 John Toews <john.toewsllc@gmail.com> wrote:
I have a need to restrict anonymous access to an object until after a specific action occurs. For example, the View permission by default is restricted to owner and manager, but after a 'release' flag is checked, it is viewable to anyone. I can't seem to find a way to do this programatically, after googling for a few hours over the past few weeks. Is it possible? I think the user running the action would need 'change permissions' rights... is there anyway to override that?
1) Provide a script that makes this change. 2) Give it the necessary permissions 3) Use the "proxy" feature to allow the script to run with its own permissions when called (look at the tabs available on the script editing view) 4) Call this script from the "action" on your release form. Cheers, Terry -- Terry Hancock (hancock@AnansiSpaceworks.com) Anansi Spaceworks http://www.AnansiSpaceworks.com
participants (3)
-
David H -
John Toews -
Terry Hancock