Browse Source

fix(gui): on inviting a new user to project provide viewer role

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4134/head
Pranav C 2 years ago
parent
commit
30496bf0bb
  1. 5
      packages/nocodb/src/lib/meta/api/projectUserApis.ts

5
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<any> {
// 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<any> {
invite_token,
invite_token_expires: new Date(Date.now() + 24 * 60 * 60 * 1000),
email,
roles: 'user',
roles: OrgUserRoles.VIEWER,
token_version: randomTokenString(),
});

Loading…
Cancel
Save