Forum OpenACS Development: Re: Joining to acs_objects and package-aware packages

Collapse
Posted by Don Baccus on
I think Peter's observation is correct ...

Now ... I've been doing some thinking about the context_id and object hierarchy issue over the last couple months, in particular when I did the permissions denormalization work for 4.6.1.

We don't really need context_id at all in objects, nor do we need security_inherit_p, because these values are denormalized in the context_object_hierarchy map which is managed by triggers on the objects table.  This denormalization was present in ACS 4.2.

My thinking has been ... why not recognize the fact that this denormalization is set in cement, because permissions won't scale without it (even with my changes to other parts of the datamodel)?  Then provide explicit API calls to flip security_inherit_p or to change the permissions context of an object?

We'd rid acs_objects of two unneeded columns (unneeded because of the denormalization) and forcing code to use an API rather than bash objects directly would make it relatively easy to enforce a convention that we do it via Tcl API ... which leads us further down the path towards a permissions API which is safe for caching ...

Then let's put in a real parent_id column - removing the then redundant parent_id column from content_item.

I think we could get away with setting the new parent_id column to the current context_id value (except for content_items which would get the existing parent_id.)  None-content objects are already frequently using this field for that purpose, and if code isn't doing so it wouldn't be hurt by it because it would be "blind" to context_id.

This is a fairly radical change but long-term would remove the temptation to use context_id as a parent_id without adding any additional bytes to an object.  And future packages would benefit from having an unambigious column available for recording object parent-child relationships.

I also think we should put package_id in basic objects.  My objections to some of the extra columns proposed by Dirk Gomez don't extend to package_id as tracking content by package is a requirement for subsite-aware packages.