Topics

Tribe Support

Tribe Support's Topics

Nick Swinford

Nick Swinford

April 25 2017

Access for notes set to public on private groups

I have a group that's set so only followers can see the profile and only admins can add new users. For all the social apps, only followers can add or comment.

I've been looking at the database though and I see that notes still have their access set as public. For all other medium nodes, their access is set to followers. I can't seem to figure why this is happening only for notes.

Which permission defines the access level of new nodes? Is there anyway to set the default access level for new notes for a group to followers?

Thanks.

Rastin Mehr
Rastin Mehr
April 25 2017 Permalink
I need to look in the code, but from what I remember, Anahita first checks with the Owner's privacy settings before checking the media nodes privacy setting.
That's what's suppose to be happening and I believe that's what's intended here:

https://github.com/anahitasocial/anahita/blob/4732bfd1325fa6728e21f17e7fce5811d5f4fa55/src/site/components/com_medium/domains/behaviors/privatable.php#L54

But after some exhaustive debugging, I've found an odd behavior. When the @col(owner.id) and @col(owner.access) are processed through AnDomainQueryHelper::processColumn they are converted to subject.id and subject.access. Instead of checking the access on the story owner, it's checking access on the story subject.

I can't seem to figure out why this is happening and what's causing the issue is because after the third nested AnDomainQueryHelper::processColumn I loose my mind.

This wouldn't normally be an issue because the dashboards are filtered to either leaders or a singular owner, but my users have been clambering for a dashboard that shows stories from the entire site and not just their leaders. I've almost gotten everything figured out, but stories from notes on private groups are throwing a wrench into the works.

I noticed something odd while debugging this. This $result will never be returned. https://github.com/anahitasocial/anahita/blob/4732bfd1325fa6728e21f17e7fce5811d5f4fa55/src/libraries/anahita/domain/query/helper.php#L192
Rastin Mehr
Rastin Mehr
April 26 2017 Permalink
I remember when we were implementing the feeds we were also asked to have a feed that showed everything and we realized not having at least one owner id was messing up the privacies.

We didn't implement it, because the feature was going against the Anahita design philosophy. Stories are coming from actors via the social graph. If you aren't following an actor, you aren't supposed to see the stories, because there isn't an edge connecting you to that actor. Building a feed that showed all the created stories was like submerging a network in water and short circuiting all the nodes.

I don't know the answer at this moment. This requires me to take the time and go over the code that we wrote quite some time ago and see what's going on.
Everything's working perfect, other than notes. The only issue with notes is that they don't have their access set. All other medium nodes have the access dropdown in their form and this sets the access. With notes tho, since we use them for private messages, they only have two access values, public or the ids of the users involved in a private messages.

I know this is a complicated issue. I don't expect an answer, just your insights are helpful enough. I'll figure something out. Thank you.
Rastin Mehr
Rastin Mehr
April 26 2017 Permalink
Have you tried overwriting the privatable behaviour in your component and changing the logic?
Rastin Mehr
Rastin Mehr
April 26 2017 Permalink
the private messages ones need to remain private anyways. The one's with public access are always public unless if the owner is private in which case the notes should stay private. Why don't you try overwriting the privatable in your component and basically filter out all but public media nodes?
Rastin Mehr
Rastin Mehr
April 28 2017 Permalink
Another approach would be getting the ids of all the actors whose stories you want to follow and build a feed for them. That should work nicely with the current architecture of Anahita.

Powered by Anahita