Browse Source

Update NcMetaIOImpl.ts (#917)

fix  not your own project 'owner'  will return first user , user_id will return null and is_creator return true

Signed-off-by: 诗人的咸鱼 <willnewii@163.com>
pull/925/head
诗人的咸鱼 3 years ago committed by GitHub
parent
commit
004deca1d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      packages/nocodb/src/lib/noco/meta/NcMetaIOImpl.ts

2
packages/nocodb/src/lib/noco/meta/NcMetaIOImpl.ts

@ -434,6 +434,7 @@ export default class NcMetaIOImpl extends NcMetaIO {
'=',
'xc_users.id'
)
.whereRaw('nc_projects.id = nc_projects_users.project_id')
.where('nc_projects_users.roles', 'like', '%owner%')
.first()
.as('owner')
@ -454,6 +455,7 @@ export default class NcMetaIOImpl extends NcMetaIO {
'%owner%'
);
})
.whereRaw('nc_projects.id = nc_projects_users.project_id')
.andWhere('xc_users.id', userId)
.first()
.as('is_creator')

Loading…
Cancel
Save