@tomei/sso
Version:
Tomei SSO Package
131 lines (130 loc) • 6.14 kB
TypeScript
import { TreeNodeBase } from '@tomei/general';
import { GroupTypeEnum } from '../../enum';
import { LoginUser } from '../login-user/login-user';
import { IGroupSearchAttr } from '../../interfaces/group-search-attr.interface';
import { Transaction } from 'sequelize';
import { SystemPrivilege } from '../system-privilege/system-privilege';
import { GroupObjectPrivilege } from '../group-object-privilege/group-object-privilege';
import { User } from '../login-user/user';
import GroupModel from '../../models/group.entity';
export declare class Group extends TreeNodeBase<Group> {
ObjectId: string;
ObjectName: string;
TableName: 'sso_Group';
ObjectType: string;
Name: string;
Description: string;
Type: GroupTypeEnum;
ParentGroupCode: string;
InheritParentPrivilegeYN: string;
InheritParentSystemAccessYN: string;
Status: string;
ParentGroup?: any;
_Path: string;
isChildrenLoaded: boolean;
isParentLoaded: boolean;
private _CreatedById;
private _CreatedAt;
private _UpdatedById;
private _UpdatedAt;
private static _Repo;
private static _GroupSystemAccessRepo;
private static _GroupPrivilegeRepo;
private static _GroupObjectPrivilegeRepo;
private static _RedisService;
get GroupCode(): string;
set GroupCode(value: string);
get CreatedById(): number;
get CreatedAt(): Date;
get UpdatedById(): number;
get UpdatedAt(): Date;
get Path(): string;
set Path(value: string);
private constructor();
static init(dbTransaction: any, GroupCode?: string): Promise<Group>;
loadChildren(dbTransaction?: any): Promise<void>;
loadParent(dbTransaction?: any): Promise<void>;
isLeaf(dbTransaction?: any): Promise<boolean>;
getPath(dbTransaction?: any): Promise<string>;
protected updatePath(dbTransaction?: any): Promise<void>;
setParent(parent: Group, dbTransaction?: any): Promise<void>;
getPathDetail(dbTransaction?: any): Promise<Group[]>;
static findAll(page: number, row: number, dbTransaction: any, loginUser: LoginUser, search?: IGroupSearchAttr): Promise<{
Count: number;
Groups: Group[];
}>;
static create(loginUser: LoginUser, dbTransaction: any, group: Group): Promise<Group>;
protected static checkDuplicateGroupCode(dbTransaction: any, GroupCode: any): Promise<void>;
private updateChildrenPath;
update(loginUser: LoginUser, dbTransaction: any, group: {
GroupCode: string;
NewGroupCode?: string;
Name: string;
Description: string;
Type: GroupTypeEnum;
ParentGroupCode: string;
InheritParentPrivilegeYN: string;
InheritParentSystemAccessYN: string;
Status: string;
}): Promise<this>;
static delete(loginUser: LoginUser, dbTransaction: any, GroupCode: string): Promise<{
Message: string;
}>;
static getSystemAccesses(loginUser: LoginUser, dbTransaction: any, GroupCode: string, Page: number, Rows: number, Search: {
SystemCode?: string;
Status?: string;
}): Promise<any>;
static getSystemAccessRoles(loginUser: LoginUser, dbTransaction: any, SystemCode: string, Page: number, Rows: number, Search: {
GroupCode?: string;
Status?: string;
}): Promise<any>;
private static getInheritedSystemAccess;
static isGroupCodeInHierarchy(dbTransaction: any, GroupCode: string, ListGroupCode?: string[]): Promise<boolean>;
static getParentSystemAccesses(loginUser: LoginUser, dbTransaction: any, GroupCode: string): Promise<any[]>;
static addSystemAccesses(loginUser: LoginUser, dbTransaction: any, GroupCode: string, SystemCodes: string[]): Promise<{
Message: string;
}>;
static deleteSystemAccess(loginUser: LoginUser, dbTransaction: any, GroupCode: string, SystemCode: string): Promise<{
Message: string;
SystemCode: string;
}>;
static getSystemPrivileges(loginUser: LoginUser, dbTransaction: any, GroupCode: string, search?: {
SystemCode?: string;
Status?: string;
}): Promise<SystemPrivilege[]>;
static getSystemPrivilegeRoles(loginUser: LoginUser, dbTransaction: any, SystemCode: string, search?: {
GroupCode?: string[];
Status?: string;
}): Promise<{
SystemPrivilegeId: string;
PrivilegeCode: string;
Description: string;
GroupCodes: {
Code: string;
Name: string;
}[];
}[]>;
static getInheritedSystemPrivileges(dbTransaction: any, GroupCode: string, search?: {
SystemCode?: string;
Status?: string;
PrivilegeCode?: string;
}): Promise<SystemPrivilege[]>;
static getParentSystemPrivileges(loginUser: LoginUser, dbTransaction: any, GroupCode: string, search?: {
SystemCode?: string;
Status?: string;
PrivilegeCode?: string;
}): Promise<SystemPrivilege[]>;
static assignGroupObjectPrivilege(loginUser: LoginUser, dbTransaction: any, GroupCode: string, GroupObjectPrivileges: GroupObjectPrivilege[], SystemCode: string): Promise<string>;
static getGroubObjectPrivileges(loginUser: LoginUser, dbTransaction: any, GroupCode: string, search?: {
PrivilegeCode?: string;
ObjectType?: string;
ObjectId?: string;
SystemCode?: string;
}): Promise<SystemPrivilege[]>;
static assignGroupPrivileges(loginUser: LoginUser, dbTransaction: any, GroupCode: string, SystemPrivilegeIds: string[]): Promise<string>;
static deleteGroupPrivilege(loginUser: LoginUser, dbTransaction: any, GroupCode: string, SystemPrivilegeIds: string[]): Promise<string>;
static getHierarchy(loginUser: LoginUser, dbTransaction: any, Status?: string, Type?: GroupTypeEnum, ParentGroupCode?: string): Promise<any[]>;
static getGroupsWithReportingUser(loginUser: User, dbTransaction: Transaction, whereOptions: any): Promise<GroupModel[]>;
unassignUser(UserId: number, loginUser: LoginUser, dbTransaction: Transaction): Promise<void>;
static getGroupTree(groupCode: string | null, loginUser: LoginUser, dbTransaction: Transaction): Promise<Group[]>;
}