-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Allow org admins to create guest users #1373
Conversation
C# Unit Tests104 tests +1 104 ✅ +1 5s ⏱️ ±0s Results for commit bd2425b. ± Comparison against base commit a8d082f. This pull request removes 1 and adds 2 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
@rmunn I just pushed this. What do you think? I'd be inclined to always (i.e. it's not optional) add new users to the org, because:
If the admin desperately doesn't want them to be in the org, they can remove them after. |
@myieye - Looks good. I fixed a lint error and a compiler error, and increased the contrast (the text-success color wasn't standing out well on a light background, see below) but otherwise I like that idea. Before the change, light BG: After the change, light BG: |
Ran out of time tonight to add the guest user to the org automatically; will add that code tomorrow morning. Then this will be ready for re-review. |
It was a little confusing, so I consolidated it with CanCreteGuestUserInProject by making the project ID optional. Site admins can create guest users without a project ID, but org admins will be required to specify a project ID when creating guest users.
@myieye - I've pushed commits 4b02d26 and a1de5f1 which assign new users to the org if they're added from the org page, and fix the problems you pointed out with the CanCreateGuestUserInAnyProject permission. (It was a mistake caused by coding late when I should have wrapped up for the evening). The permissions structure should be more sensible and comprehensible now. |
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.
looks good, I suggest making projectId non nullable now. I'm not sure that orgId should be nullable, but I'm fine with how it works now.
@hahn-kev - One review comment addressed. The other one I don't think is actually necessary, but if you say "Let's make the change anyway" then I'll go ahead and do it tomorrow. |
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.
looks good to me! Nice work
Fixes #1268.
This adds the same "Create User" button, with the same dialog, to the org page that is on the admin dashboard, if the currently logged-in user has the right to manage the org (i.e., is an org admin).
It goes to the same "Create User" dialog as the one on the admin page (not screenshotted because this PR makes no changes to it), and has the same effect (if no email provided, creates guest user with "CreatedById" set to the org admin).
One possible improvement, which I have not yet made, would be that if an org admin creates a guest user, that user is automatically added to the currently-viewed org. (With, perhaps, a checkbox to turn that off, in the rare case where an org admin might be wanting to add a guest user NOT associated with any org — but the default should be on).
@myieye - Your thoughts on UI would be welcome. For example, should we change the name of this button when it's on the org page? I feel like having "Add Member", "Bulk Add Members", and "Create User" buttons all one after the other end up being a little much and has the potential for user confusion. But as I'm writing this, it's kind of late in the day and I'm having trouble thinking of what the alternative might be. I'll probably have better ideas tomorrow morning, though.