Skip to content

add option to disable account creation if no mapped roles or default role#59

Merged
michaelryanmcneill merged 3 commits intomichaelryanmcneill:2.2-alphafrom
dandalpiaz:master
Jun 17, 2020
Merged

add option to disable account creation if no mapped roles or default role#59
michaelryanmcneill merged 3 commits intomichaelryanmcneill:2.2-alphafrom
dandalpiaz:master

Conversation

@dandalpiaz
Copy link
Contributor

No description provided.

Copy link
Collaborator

@jrchamp jrchamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really good to me. I want to know your thoughts on adding underscores to the noaccount role to indicate that it's a reserved word, like _no_account. I'm not sure if I prefer with or without the extra literal spaces around the inline selected(), nor how I would alter the "Do NOT" language to make it less loud.

@dandalpiaz
Copy link
Contributor Author

Added a new commit to change the "noaccount" name to "_no_account"; I think that's better. I also made an update to the selected() function to follow the formatting shown at the bottom of this reference page, https://developer.wordpress.org/reference/functions/selected/.

I agree, the "Do NOT" label is pretty harsh sounding - definitely open to other label names. "Prevent account creation"? Or maybe add "(none)" to the label as well to give it juxtaposition to the existing "(none)", e.g. "(none) - prevent account creation". Any other ideas?

I'm pretty new to plugin development, so I appreciate all the feedback!

@jrchamp
Copy link
Collaborator

jrchamp commented Aug 6, 2019

Comparing this to the existing "(none)", I think the parentheses imbues special meaning. As far as meaning, choosing this option will mean that:

  • when a user does not have an account
  • and that user does not have a non-default role mapping
  • and the default role mapping is _no_account
  • then do not create an account for them

Conversely as positives:

  • when a new user needs an account
  • and that user's role mapping is _no_account
  • then skip account creation

Perhaps "(skip 'no role' account creation)" or "(none) and skip '(none)' account creation"? Part of me wants to rename the "(none)" item to "(no role)"...

Hopefully these ideas help somewhat. Ultimately, I think you're on the right track and whatever you decide is probably best. 👍 Thank you for your contributions on this @dandalpiaz !

Copy link
Collaborator

@jrchamp jrchamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is easily the simplest solution I've seen to address #51

Thank you @dandalpiaz for providing this.

@neverything
Copy link

Tested this pull request on a system I work with and it works as promised, thanks @dandalpiaz. I'll use this version starting next week up until a new release with this included is ready.

@michaelryanmcneill michaelryanmcneill self-assigned this May 28, 2020
@michaelryanmcneill michaelryanmcneill changed the base branch from master to 2.2-alpha June 17, 2020 18:06
@michaelryanmcneill michaelryanmcneill merged commit daf55f9 into michaelryanmcneill:2.2-alpha Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto create account with "none" as default role should deny access to unmapped users

4 participants