mirror of
https://github.com/flarum/framework.git
synced 2025-02-06 06:56:14 +08:00
Merge pull request #1938 from flarum/ds/1255-throttling-bypass-permission
Add permission to bypass throttling
This commit is contained in:
commit
969bd18001
|
@ -210,6 +210,12 @@ export default class PermissionGrid extends Component {
|
|||
permission: 'discussion.delete'
|
||||
}, 80);
|
||||
|
||||
items.add('postWithoutThrottle', {
|
||||
icon: 'fas fa-swimmer',
|
||||
label: app.translator.trans('core.admin.permissions.post_without_throttle_label'),
|
||||
permission: 'postWithoutThrottle'
|
||||
}, 70);
|
||||
|
||||
items.add('editPosts', {
|
||||
icon: 'fas fa-pencil-alt',
|
||||
label: app.translator.trans('core.admin.permissions.edit_posts_label'),
|
||||
|
|
|
@ -33,6 +33,10 @@ class Floodgate
|
|||
*/
|
||||
public function assertNotFlooding(User $actor)
|
||||
{
|
||||
if ($actor->can('postWithoutThrottle')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($this->isFlooding($actor)) {
|
||||
throw new FloodingException;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user