Forum OpenACS Development: Re: Adding a parent_id to acs_objects ...

Collapse
Posted by Don Baccus on
Yes, I was thinking in terms of providing both Tcl API and PL/[pg]SQL API.

As far as your first question goes I suppose it would be possible to do as you ask, though I've not thought of it before.  It would actually make it simple to solve a .LRN permissions problem we're currently dickering about in e-mail now that you mention it.

The notion would be to add one parent-child row to the context hierarchy table rather than zap it with all a child's parents as is done when security_inherit_p is true.

Hmmm ... interesting idea.  There's a utility vs. confuse-the-programmer trade-off to consider, though.

Collapse
Posted by Tom Jackson on

So could the security_inherit_p just be a flag to the same proc to loop over the necessary inserts?

Security inherit is the default now, isn't it? In ad_proc format:


ad_proc some_context_setting_proc {
   {-object_id}
   {-context_id}
   {-security_inherit_p "true"}
} ...

which would just wrap the pl procedure taking the three arguments. Or optionally you could specify the number of levels up the hierarchy to go. Zero would be the same as setting security_inherit_p to "false", -1 could imply all the way up??? Some positive number would indicate an intermediate inheritance. So something like -inherit_levels "-1" would be the default.