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

Webhooks on soft-deleted posts #28

Closed
sburkett opened this issue Jan 4, 2021 · 7 comments
Closed

Webhooks on soft-deleted posts #28

sburkett opened this issue Jan 4, 2021 · 7 comments

Comments

@sburkett
Copy link

sburkett commented Jan 4, 2021

I'm not even sure why I can reply to soft-deleted messages, but nevertheless, it seems to still trigger the related webhook.

Running beta 15.

@dsevillamartin
Copy link
Member

Can you clarify? Is the discussion soft-deleted, the first post soft-deleted, or...? I'm not sure exactly what the situation you are describing is or what the related webhook is either.

@sburkett
Copy link
Author

sburkett commented Jan 4, 2021

Sorry, was in a bit of a rush when I posted that yesterday. The discussion was soft-deleted. I've confirmed this by looking in the discussions table, and I can see the hidden stamp.

Though, it does seem strange. This is probably a core issue, but the admin user can see the soft-deleted discussions, which makes sense, but so can the creator, which seems sort of weird. And the admin and creator (at least) can still reply to it, though I haven't tried any other user accounts.

Unless I'm missing something, there doesn't seem to be an option (or permission) inside of Flarum to prevent people from replying to their own threads that are soft-deleted.

@dsevillamartin
Copy link
Member

I don't think that's an option in core, yeah. Do you have the webhook set to Admin or Guest viewing?

@sburkett
Copy link
Author

sburkett commented Jan 4, 2021

Ah, that is probably the reason why. I ended up having to do Admin, since Guest wasn't working for me. Not sure why Guest wasn't working, unless it truly means a "guest", as in a non-registered member. This particular site is a member's only site for a gaming guild.

@sburkett
Copy link
Author

sburkett commented Jan 5, 2021

If my hypothesis above is correct, would it be possible to add actual defined groups to the dropdown, rather than just "Admin" or "Guest"?

@dsevillamartin
Copy link
Member

Not sure why Guest wasn't working, unless it truly means a "guest", as in a non-registered member. This particular site is a member's only site for a gaming guild.

That'd be why :)

If my hypothesis above is correct, would it be possible to add actual defined groups to the dropdown, rather than just "Admin" or "Guest"?

I tried, and failed.

The problem with this (at least how I attempted to implement it) is that Flarum uses actual users and checks permissions against them - if I create a fake user that isn't in DB the permission checks will try to access things in DB and most likely error. This was a long time ago so things may have changed, though I don't think so.

There might be another way to implement it or I may also have just been doing something wrong. 🤷 I just remember the permission checks not working as they should've.

@dsevillamartin
Copy link
Member

Closed due to the question asked being resolved. An issue already exists for improved Group support, see #43.

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

2 participants