fix: Add ability to choose user permission level when inviting (#2473)
* Select user role while sending invite * Add tests to check for role * Update app/scenes/Invite.js Co-authored-by: Tom Moor <tom.moor@gmail.com> * Use select * Use inviteUser policy * Remove unnecessary code * Normalize rank/role Fix text sizing of select input, fix alignment on users invite form * Move component to root * cleanup Co-authored-by: Tom Moor <tom.moor@gmail.com>
This commit is contained in:
@@ -181,7 +181,7 @@ router.post("users.demote", auth(), async (ctx) => {
|
||||
const actor = ctx.state.user;
|
||||
ctx.assertPresent(userId, "id is required");
|
||||
|
||||
to = to === "Viewer" ? "Viewer" : "Member";
|
||||
to = to === "viewer" ? "viewer" : "member";
|
||||
|
||||
const user = await User.findByPk(userId);
|
||||
|
||||
@@ -262,7 +262,7 @@ router.post("users.invite", auth(), async (ctx) => {
|
||||
|
||||
const { user } = ctx.state;
|
||||
const team = await Team.findByPk(user.teamId);
|
||||
authorize(user, "invite", team);
|
||||
authorize(user, "inviteUser", team);
|
||||
|
||||
const response = await userInviter({ user, invites, ip: ctx.request.ip });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user