-
-
Notifications
You must be signed in to change notification settings - Fork 835
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
Add permission to bypass throttling #1938
Conversation
|
@luceos Ok, I'll move it to moderation. If the discussion posting doesn't have a floodgate, why does the controller assert that it shouldn't throttle? |
Feel free to merge once the pr is merged to English. |
@luceos 👍 What should the wording be? "Bypass posting floodgate"/"Bypass post throttling"...? |
How about "Reply multiple times without waiting" in keeping with our other Permission names? |
Hmm, what about the permission name? That @tobyzerner If you happen to read this... can you explain the idea behind the naming scheme? Why are some of the permission names scoped, and others aren't? |
They are scoped so that specific policies can check them. eg. DiscussionPolicy's |
Also only those permissions prefixed with discussion can be configured per tag. |
I actually pondered on the idea of changing the default hard-coded time limit for the floodgate to something configurable as a group permission to either set it to 0 (bypass floodgate) or a set value (i.e. 30 seconds, 2 minutes, etc) but that may be more work to do I assume. I'm referencing https://github.com/flarum/core/blob/d492579638fb52dafbfe65f1f36a95eb6047f7f3/src/Post/Floodgate.php#L45-L52 this method of course. I like the approach to provide as much flexibility with permissions as possible as it can also be used as an award or restricted group permission respectively. |
@Ralkage There's probably an issue for that already, and it's outside the scope of this PR. |
af8775d
to
b5c1e78
Compare
I removed the prefix in the permission name, and encapsulated the permission check in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy now! 😀
b5c1e78
to
711e775
Compare
Fixes #1255.
Continues #1586.
floodgate.postWithoutThrottle
Confirmed
php vendor/bin/phpunit
).Required changes: