-
Notifications
You must be signed in to change notification settings - Fork 8
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
Enforce 2FA for super admins #17
Conversation
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.
LGTM, I've added some comments on my thoughts of implementation, but I think this is good to go regardless of those.
$allcaps = array( | ||
'subscriber' => true, | ||
'read' => true, | ||
); |
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.
Another option here I think is to return the do_not_allow
cap when the requested cap is anything other than the whitelisted caps.
I believe that would override the super-admin always-truthful caps too, but remove_super_admins_until_2fa_enabled()
would be best kept still then too.
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.
Ah, that's a good point 👍🏻
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.
Er, nevermind, it looks like user_has_cap
doesn't even get called in that case.
I'll wait until Monday to deploy the |
See #6
This adds a few roles to get started. If this looks good, we can add more in a future PR.
This will require a small change to
capes.php
: