mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-26 11:34:58 +02:00
UBERF-5603 (#4754)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import { Client } from '..'
|
||||
import { AccountRole, Client } from '..'
|
||||
import type { Class, Doc, Obj, Ref } from '../classes'
|
||||
import core from '../component'
|
||||
import { Hierarchy } from '../hierarchy'
|
||||
@@ -250,7 +250,7 @@ describe('memdb', () => {
|
||||
})
|
||||
const account = await model.createDoc(core.class.Account, core.space.Model, {
|
||||
email: 'email',
|
||||
role: 0
|
||||
role: AccountRole.User
|
||||
})
|
||||
await model.updateDoc(core.class.Space, core.space.Model, space, { $push: { members: account } })
|
||||
const txSpace = await model.findAll(core.class.Space, { _id: space })
|
||||
|
||||
@@ -366,9 +366,20 @@ export interface Account extends Doc {
|
||||
* @public
|
||||
*/
|
||||
export enum AccountRole {
|
||||
User,
|
||||
Maintainer,
|
||||
Owner
|
||||
Guest = 'GUEST',
|
||||
User = 'USER',
|
||||
Maintainer = 'MAINTAINER',
|
||||
Owner = 'OWNER'
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export const roleOrder: Record<AccountRole, number> = {
|
||||
[AccountRole.Guest]: 1,
|
||||
[AccountRole.User]: 2,
|
||||
[AccountRole.Maintainer]: 3,
|
||||
[AccountRole.Owner]: 4
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user