Closed (fixed)
Project:
Flood control
Version:
2.2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
4 Aug 2021 at 16:55 UTC
Updated:
22 May 2023 at 12:18 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
batigolixSounds good. Can you provide a patch?
Comment #3
anybodyYes, I'll create a MR as soon as I can but currently I'm very busy so first I wanted to write down the idea and benefits so if someone else needs it earlier, please help out!
Comment #4
batigolixNo worries. Maybe I do it when I'm ready reviewing the issues. Thanks in advance!
Comment #6
anybodyStill requires an update hook to update permissions! Saw a snippet for that some days ago, but couldn't find it yet.
Comment #7
grevil commentedComment #8
grevil commented@batigolix little sidenote, please specify the 2.2.x branch as the repositories default branch, so people working on the module do not get confused AND automatic issue branch creation won't use 2.0.x as their base repo, thanks!
Comment #9
grevil commentedRebased the fork on 2.2.x maybe we can redirect the MR to 2.2.x instead of 2.0.x?
Comment #12
anybody@Grevil: MR is ready, I made to change the target branch xD
Comment #13
grevil commented@batigolix Also note, that #3270116: Better to hide "Flood Control settings page" link from top markup if the user doesn't has a permission introduced a new "access flood control settings page" which is nowhere used in 2.2.x. I don't really know if we should remove this permission here and keep @Anybody's permission changes to the "flood_control.settings" page, or if we should use the "access flood control settings page" instead.
I think we just keep Anybody's change and remove the permission again, as it has no use. If you are against this change, feel free to revert it! :)
EDIT: The permission is actually used, but not for the admin page! Quite confusing to say the least, so I will replace the occurrence with "administer flood unblock".
Comment #14
grevil commentedAll right, all done and fixed!
I additionally tested the update process, to see if the update hook works as expected, and it does! Please review! :)
Comment #15
anybodyGreat work @Grevil! LGTM and the next points are just for perfection:
1. Should we perhaps prefix
unblock ipspermission withflood? =>flood unblock ipsto make the context totally clear?2. You used
access flood unblockinstead ofaccess flood control settings pagefor the update hook. Is there a good reason? I'm not sure which one fits better, but might be the other one? (unsure).3. Finally would be great to have some tests for the permissions to work correctly.
Comment #16
anybodyBTW this cleanup is really nice, as some permissions seem to have been added by the merge of https://www.drupal.org/project/flood_unblock - that was before creating this issue.
Cleaning things up by the update hook is a good thing now. So RE #15.2 perhaps it makes sense to map the permissions separately?
Comment #17
grevil commentedTests need further work, I'll resume my work here tomorrow.
Comment #18
grevil commented@batigolix, further note: Enabling automated testing for issue branches would be also a nice addition! :)
Comment #19
grevil commentedAll finished! Tests are all green locally!
@batigolix I hope you don't mind, that I tinkered quite a lot with your tests! :)
Please review.
Comment #20
anybodyWónderful work, @Grevil! :)
RTBC!
@batigolix would you mind enabling tests for issues then perhaps?
Comment #21
anybodyPS: And as this is changing the permissions, please also test manually before merging this.
Comment #22
grevil commentedAlready tested the update hook manually, and normal access is secured by the tests.
Comment #23
arantxioI had issues patching this MR to the new 2.2.4 branch so i've made a patch on the latest available branch.
Comment #24
fabianderijkBoth the MR as the patch won't apply to the new 2.3.x branch. Could you please check?
Comment #25
arantxioCreated a new patch, it hasn't changed that much, but just enough for it to fail to apply apparently.
Comment #26
arantxioComment #27
batigolixPatch applies well to 2.3.x
Comment #28
anybodyThank you all! So @batigolix are you planning to merge this soon?
Comment #29
fabianderijkComment #31
fabianderijkThis is fixed in the dev version, will create a new release version today.
Comment #32
grevil commentedAwesome! Thank you @fabianderijk!
Comment #34
everhee commentedHello, Some olders permissions appears in drupal 10 upgrade status with an alert :
- access flood control settings page
- access flood unblock
To remove those alerts, I add to revoke them in flood_control.install by adding :
Do you think, it could block Drupal 10 upgrade ?
Comment #35
dieterholvoet commented@everhee I just encountered the same problem, opened a new issue: #3361842: Revoke old permissions from roles.