From 30496bf0bb04e161aa4209556c99dfb5e1646d8f Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 19 Oct 2022 12:39:47 +0530 Subject: [PATCH] fix(gui): on inviting a new user to project provide viewer role Signed-off-by: Pranav C --- packages/nocodb/src/lib/meta/api/projectUserApis.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/nocodb/src/lib/meta/api/projectUserApis.ts b/packages/nocodb/src/lib/meta/api/projectUserApis.ts index de4cf2871a..9d10498de5 100644 --- a/packages/nocodb/src/lib/meta/api/projectUserApis.ts +++ b/packages/nocodb/src/lib/meta/api/projectUserApis.ts @@ -1,3 +1,4 @@ +import { OrgUserRoles } from '../../../enums/OrgUserRoles' import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { Router } from 'express'; import { PagedResponseImpl } from '../helpers/PagedResponse'; @@ -65,7 +66,7 @@ async function userInvite(req, res, next): Promise { // todo : provide a different role await User.update(user.id, { - roles: 'user', + roles: OrgUserRoles.VIEWER, }); await ProjectUser.insert({ @@ -102,7 +103,7 @@ async function userInvite(req, res, next): Promise { invite_token, invite_token_expires: new Date(Date.now() + 24 * 60 * 60 * 1000), email, - roles: 'user', + roles: OrgUserRoles.VIEWER, token_version: randomTokenString(), });