Browse Source

Merge pull request #6388 from nocodb/nc-fix/role-power

fix: null check for role power function
pull/6415/head
mertmit 1 year ago committed by GitHub
parent
commit
5056ee38f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      packages/nocodb/src/utils/roleHelper.ts

4
packages/nocodb/src/utils/roleHelper.ts

@ -5,6 +5,10 @@ import type { ProjectRoles } from 'nocodb-sdk';
export function getProjectRolePower(user: any) {
const reverseOrderedProjectRoles = [...OrderedProjectRoles].reverse();
if (!user.project_roles) {
NcError.badRequest('Role not found');
}
// get most powerful role of user (TODO moving forward we will confirm that user has only one role)
let role = null;
let power = -1;

Loading…
Cancel
Save