tsgrp / HPI

OpenContent Management Suite (OCMS)
http://www.tsgrp.com/products
17 stars 5 forks source link

Building stage link fails if user does not have access to ALL parents #2455

Closed katiebrill closed 2 years ago

katiebrill commented 2 years ago

This is an issue with a workaround (the workaround being that security can be setup on all parents of a document if the document has multiple parents)

In ACA when building a stage link to a document a call is made to get the parents of the document.

Only one of these parents is needed to build the stage url (If the document has multiple parents, ACA will user the parent with the object type that matches what is configured on that trac in the ACA admin)

That being said, the get parents call in OC currently errors out whenever the user making the stage request doesn't have access to ALL parents. This is because the getParents call calls getProperties on each of the parents that are returned... so if the user doesn't have access to ONE of those parents, then the getProperties call on that node will error.

The solution is to swallow the errors on that getProperties call so that the getParents method will just return any parents THAT THE USER HAS ACCESS TO rather than bombing out when the user can't access one of the many parents.

katiebrill commented 2 years ago

OC commit: 27039

Updating the getParents call to swallow any errors that occur when calling getProperties on each parent that comes back. This way the method will return any parents that the user does have access to rather than erroring out if the user is unable to view props on any ONE of the parents of the node.

CR: aking, cadcock, gsteimer, dgrumieaux