Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enforce follower rules per channel. #82

Open
imaginator opened this issue Sep 5, 2012 · 7 comments
Open

enforce follower rules per channel. #82

imaginator opened this issue Sep 5, 2012 · 7 comments
Assignees
Milestone

Comments

@imaginator
Copy link
Member

We've got a bit of a bizarre situation where a follower can be a channel owner and a moderator. This is confusing for the user since being a moderator eclipses any capabilities of a lower role.

I've added a set of follower rules to the XEP https://buddycloud.org/wiki/XMPP_XEP#Follower_Roles such that:

  • Each channel follower should be just listed once (a user cannot be a channel owner and banned for example)
  • Each channel can have just one owner
  • If the channel is a personal channel then that owner must match the channel JID

We need to add checking for roles and enforce this behavior when users change roles

@highfellow
Copy link
Member

I've noticed this happening, but didn't realise it was a server issue.
It also happens between 'follower+post' and 'follower' - a follower who
can post also appears in followers.

@Schnouki
Copy link
Member

Schnouki commented Sep 5, 2012

Yes, the current state of affiliations is... less than optimal. Like affiliations (and subscriptions) being per-node instead of per-channel. And in the DB you'll also see some "follower+post" affiliations instead of "publisher". Old bugs.

I have plans to fix this but it will take time (and this week I've already worked more on the server than on my thesis). For now, could you work around this in the new web client? Only keeping the highest affiliation for each JID, and ignoring *@anon.* entries...

@imaginator
Copy link
Member Author

We can totally work around it. Just getting it on the list so we don't loose it.

@Schnouki. Noted. Thanks for all you hard work on the server.

@tkoski
Copy link
Member

tkoski commented Sep 6, 2012

Hi,

yes, IMHO the subscription + affiliation mayhem originating from XEP-0060
is quite a mayhem to handle. Not optimal at all and quite PITA in our
use-case.

However it's has always been like that in bc because it "somehow worked"
and was following the XEP-0060. Also there was no better idea raised.

So, if someone comes up with a more simple and straight forward logic and
rules, I would be the first one to raise my hand hand to vote +1 to change
it.

Cheers,

Tuomas

On 6 September 2012 01:24, Thomas Jost [email protected] wrote:

Yes, the current state of affiliations is... less than optimal. Like
affiliations (and subscriptions) being per-node instead of per-channel. And
in the DB you'll also see some "follower+post" affiliations instead of
"publisher". Old bugs.

I have plans to fix this but it will take time (and this week I've already
worked more on the server than on my thesis). For now, could you work
around this in the new web client? Only keeping the highest affiliation for
each JID, and ignoring *@anon.* entries...


Reply to this email directly or view it on GitHubhttps://github.com//issues/82#issuecomment-8317520.

@ghost ghost assigned lloydwatkin Sep 7, 2012
@lloydwatkin
Copy link
Member

Had a look at the server today, it would seem that a user can not have more than one affiliation for a node due to unique index on the affiliations table. I'm wondering whether the issue has arisen because the beta system doesn't have this index applied?

We could find this out by running a query and checking the results (I've noticed @Imaginators channel suffers this issue so we could use that?).

If this is the case then all we would require is a script to clean up the database and the application of the unique index to begin. Later we can see how this issue arose.

If not then I'll have to look more deeply into the problem but I'll need access to some example "bad" data.

@lloydwatkin
Copy link
Member

Unique keys on the affiliations table prevents duplicate affiliations from being created:

[lloyd@desktop buddycloud-server]$ psql -d buddycloud-server -c "insert into affiliations values('/user/[email protected]/posts', '[email protected]', 'moderator')"
ERROR:  duplicate key value violates unique constraint "affiliations_pkey"

@imaginator
Copy link
Member Author

Excellent. Nice to know.

On 9 September 2012 05:40, Lloyd Watkin [email protected] wrote:

Unique keys on the affiliations table prevents duplicate affiliations from
being created:

[lloyd@desktop buddycloud-server]$ psql -d buddycloud-server -c "insert into affiliations values('/user/[email protected]/posts', '[email protected]', 'moderator')"
ERROR: duplicate key value violates unique constraint "affiliations_pkey"


Reply to this email directly or view it on GitHubhttps://github.com//issues/82#issuecomment-8403270.

Simon Tennant | buddycloud.com | +49 17 8545 0880

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants