Do you think we could have the option to restrict login by IP per role? Instead of just removing the role from the user, completely denying them login access, similar to restricting user login by ip?

Perhaps toggleable via a setting on the General Settings tab.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

EAnushan created an issue. See original summary.

haza made their first commit to this issue’s fork.

haza’s picture

I’m revisiting this old issue, as the underlying idea still seems relevant and useful.

In my use case, I needed this kind of behavior, so I’ve implemented a new checkbox on the “Restrict role by IP” configuration page. This checkbox allows administrators to toggle between the current “role removal” behavior and an alternative option to deny access to the user instead.

Happy to share the patch/merge request if there’s interest in reviewing or incorporating this functionality.

haza’s picture

Status: Active » Needs review
darvanen’s picture

Status: Needs review » Needs work

I can see how that would be useful, sure, happy to review work on this.

haza’s picture

Status: Needs work » Needs review

I forgot to open the MR.
Here is the first approach to solve this.

darvanen’s picture

Status: Needs review » Needs work
anybody’s picture

I also agree this would be useful for roles feature. @haza any plans to proceed here?

darvanen’s picture

Version: 8.x-4.x-dev » 9.x-dev
Assigned: Unassigned » darvanen

  • darvanen committed 474d4cb5 on 9.x
    feat: #2825927 Restrict Role by IP - Deny Access
    
    By: eanushan
    By: haza...

darvanen’s picture

Assigned: darvanen » Unassigned
Status: Needs work » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.