公共组管理对象

公共组的增删改查

interface Manager {
    addPortalUsersByID: ((pgID, portalUserIDs) => void);
    addPublicGroupsByID: ((pgID, groupIDs) => void);
    addRolesAndSubsByID: ((pgID, RoleIDs) => void);
    addRolesByID: ((pgID, RoleIDs) => void);
    addUsersByID: ((pgID, userIDs) => void);
    create: ((ps) => string);
    getByID: ((id) => PublicGroup);
    getByName: ((name) => PublicGroup);
    getList: ((qo?) => PublicGroup[]);
    getPortalUsersByID: ((pgID, qo?) => string[]);
    getPublicGroupsByID: ((pgID, qo?) => string[]);
    getRolesAndSubsByID: ((pgID, qo?) => string[]);
    getRolesByID: ((pgID, qo?) => string[]);
    getUsersByID: ((pgID, qo?) => string[]);
    remove: ((id) => void);
    removePortalUsersByID: ((pgID, portalUserIDs) => void);
    removePublicGroupsByID: ((pgID, groupIDs) => void);
    removeRolesAndSubsByID: ((pgID, RoleIDs) => void);
    removeRolesByID: ((pgID, RoleIDs) => void);
    removeUsersByID: ((pgID, userIDs) => void);
}

Properties

addPortalUsersByID: ((pgID, portalUserIDs) => void)

添加业务用户

Type declaration

    • (pgID, portalUserIDs): void
    • Parameters

      • pgID: string
      • portalUserIDs: string[]

      Returns void

addPublicGroupsByID: ((pgID, groupIDs) => void)

添加公共组

Type declaration

    • (pgID, groupIDs): void
    • Parameters

      • pgID: string
      • groupIDs: string[]

      Returns void

addRolesAndSubsByID: ((pgID, RoleIDs) => void)

添加角色及下属

Type declaration

    • (pgID, RoleIDs): void
    • Parameters

      • pgID: string
      • RoleIDs: string[]

      Returns void

addRolesByID: ((pgID, RoleIDs) => void)

添加角色

Type declaration

    • (pgID, RoleIDs): void
    • Parameters

      • pgID: string
      • RoleIDs: string[]

      Returns void

addUsersByID: ((pgID, userIDs) => void)

添加用户

Type declaration

    • (pgID, userIDs): void
    • Parameters

      • pgID: string
      • userIDs: string[]

      Returns void

create: ((ps) => string)

创建公共组

Type declaration

    • (ps): string
    • Parameters

      • ps: PublicGroupOpts

        公共组参数,必选参数name,label,memberMap,且memberMap至少包含一个成员。

      Returns string

Example


import * as pg from "publicgroup"

let mgr = pg.newManager()
let id = mgr.create({ name: "kwtest",
label: "kwtest",
memberMap: { user: ["10gd000000En2xfeFqQy"] } })
let publicGroup = mgr.getByID(id)

Returns

公共组ID

getByID: ((id) => PublicGroup)

获取公共组对象

Type declaration

getByName: ((name) => PublicGroup)

获取公共组对象

Type declaration

getList: ((qo?) => PublicGroup[])

获取公共组列表

Type declaration

Returns

公共组列表(不包含成员信息)

getPortalUsersByID: ((pgID, qo?) => string[])

获取成员业务用户

Type declaration

    • (pgID, qo?): string[]
    • Parameters

      Returns string[]

getPublicGroupsByID: ((pgID, qo?) => string[])

获取成员公共组

Type declaration

    • (pgID, qo?): string[]
    • Parameters

      Returns string[]

getRolesAndSubsByID: ((pgID, qo?) => string[])

获取成员角色及下属

Type declaration

    • (pgID, qo?): string[]
    • Parameters

      Returns string[]

getRolesByID: ((pgID, qo?) => string[])

获取成员角色

Type declaration

    • (pgID, qo?): string[]
    • Parameters

      Returns string[]

getUsersByID: ((pgID, qo?) => string[])

获取成员用户

Type declaration

    • (pgID, qo?): string[]
    • Parameters

      Returns string[]

remove: ((id) => void)

删除公共组

Type declaration

    • (id): void
    • Parameters

      • id: string

        公共组ID

      Returns void

removePortalUsersByID: ((pgID, portalUserIDs) => void)

移除成员业务用户

Type declaration

    • (pgID, portalUserIDs): void
    • Parameters

      • pgID: string
      • portalUserIDs: string[]

      Returns void

removePublicGroupsByID: ((pgID, groupIDs) => void)

移除成员公共组

Type declaration

    • (pgID, groupIDs): void
    • Parameters

      • pgID: string
      • groupIDs: string[]

      Returns void

removeRolesAndSubsByID: ((pgID, RoleIDs) => void)

移除成员角色及下属

Type declaration

    • (pgID, RoleIDs): void
    • Parameters

      • pgID: string
      • RoleIDs: string[]

      Returns void

removeRolesByID: ((pgID, RoleIDs) => void)

移除成员角色

Type declaration

    • (pgID, RoleIDs): void
    • Parameters

      • pgID: string
      • RoleIDs: string[]

      Returns void

removeUsersByID: ((pgID, userIDs) => void)

移除成员用户

Type declaration

    • (pgID, userIDs): void
    • Parameters

      • pgID: string
      • userIDs: string[]

      Returns void