@ieeesa-npm/groups 0.10.1 → 0.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/assets/constants.json +2 -0
- package/esm2022/lib/components/create-group/create-group.component.mjs +25 -9
- package/esm2022/lib/components/tree-view/tree-view.component.mjs +14 -9
- package/esm2022/lib/components/view-roster/view-roster.component.mjs +3 -2
- package/esm2022/lib/groups.component.mjs +13 -9
- package/esm2022/lib/models/group-info.model.mjs +1 -1
- package/esm2022/lib/models/permission-type.model.mjs +6 -2
- package/esm2022/lib/services/group-permissions-map-service.mjs +42 -6
- package/esm2022/lib/services/groups.service.mjs +15 -5
- package/esm2022/lib/services/user-permissions.service.mjs +3 -5
- package/fesm2022/ieeesa-npm-groups.mjs +112 -38
- package/fesm2022/ieeesa-npm-groups.mjs.map +1 -1
- package/lib/components/create-group/create-group.component.d.ts +8 -0
- package/lib/groups.component.d.ts +3 -1
- package/lib/models/group-info.model.d.ts +2 -0
- package/lib/models/permission-type.model.d.ts +6 -2
- package/lib/services/group-permissions-map-service.d.ts +13 -0
- package/lib/services/groups.service.d.ts +16 -10
- package/lib/services/user-permissions.service.d.ts +1 -1
- package/package.json +4 -4
|
@@ -199,6 +199,14 @@ export declare class CreateGroupComponent implements OnInit, OnDestroy {
|
|
|
199
199
|
* @memberof CreateGroupComponent
|
|
200
200
|
*/
|
|
201
201
|
getParentGroups(groupId: string): void;
|
|
202
|
+
/**
|
|
203
|
+
* Update passed form field values.
|
|
204
|
+
* @param {string} formControlName
|
|
205
|
+
* @param {string} formControlInputProperty
|
|
206
|
+
* @param {*} value
|
|
207
|
+
* @memberof CreateGroupComponent
|
|
208
|
+
*/
|
|
209
|
+
updateFormControlOptions(formControlName: string, formControlInputProperty: string, value: any): void;
|
|
202
210
|
/**
|
|
203
211
|
* Adds/removes new parent group selection options whenever Change Parent Group slider is toggled.
|
|
204
212
|
* @param {SlideToggleOption} toggle
|
|
@@ -13,6 +13,7 @@ import { EditGroupAndParentInfo } from './models/edit-group.model';
|
|
|
13
13
|
import { UserPermissionsService } from './services/user-permissions.service';
|
|
14
14
|
import { GroupPermission, UserPermission } from './models/group-permissions.model';
|
|
15
15
|
import { PermissionType } from './models/permission-type.model';
|
|
16
|
+
import { GroupPermissionsMapService } from './services/group-permissions-map-service';
|
|
16
17
|
import * as i0 from "@angular/core";
|
|
17
18
|
/**
|
|
18
19
|
* Groups component is a wrapper or container component for groups management reusable component and in this component integrates all group management functionalities and this will be entry component for managing groups when it is consumed in other applications.
|
|
@@ -25,6 +26,7 @@ export declare class GroupsComponent implements OnInit, OnDestroy {
|
|
|
25
26
|
private breakpointObserverService;
|
|
26
27
|
globalErrorHandlerService: GlobalErrorHandlerService;
|
|
27
28
|
private userPermissionsService;
|
|
29
|
+
private groupPermissionsService;
|
|
28
30
|
destroy$: Subject<boolean>;
|
|
29
31
|
dialogRef: any;
|
|
30
32
|
constants: any;
|
|
@@ -67,7 +69,7 @@ export declare class GroupsComponent implements OnInit, OnDestroy {
|
|
|
67
69
|
trimmedSearchTerm: string;
|
|
68
70
|
userGroupPermissions: GroupPermission[];
|
|
69
71
|
supportMessage: string;
|
|
70
|
-
constructor(dialog: MatDialog, groupsService: GroupsService, alertService: AlertsService, breakpointObserverService: BreakpointObserverService, globalErrorHandlerService: GlobalErrorHandlerService, userPermissionsService: UserPermissionsService);
|
|
72
|
+
constructor(dialog: MatDialog, groupsService: GroupsService, alertService: AlertsService, breakpointObserverService: BreakpointObserverService, globalErrorHandlerService: GlobalErrorHandlerService, userPermissionsService: UserPermissionsService, groupPermissionsService: GroupPermissionsMapService);
|
|
71
73
|
/**
|
|
72
74
|
* Initialize the groups component.
|
|
73
75
|
* @return -returns nothing
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { UserPermission } from './group-permissions.model';
|
|
1
2
|
import { GroupType } from './group-types.model';
|
|
2
3
|
export interface GroupInfo {
|
|
3
4
|
groupId: string;
|
|
@@ -12,4 +13,5 @@ export interface GroupInfo {
|
|
|
12
13
|
groupTypeInfo?: GroupType;
|
|
13
14
|
children?: GroupInfo[];
|
|
14
15
|
noOfChildren?: number;
|
|
16
|
+
permissions: UserPermission[] | null;
|
|
15
17
|
}
|
|
@@ -4,9 +4,13 @@ export declare enum PermissionType {
|
|
|
4
4
|
CREATE_SUBGROUP = "CREATE_SUBGROUP",
|
|
5
5
|
EDIT_GROUP = "EDIT_GROUP",
|
|
6
6
|
DELETE_GROUP = "DELETE_GROUP",
|
|
7
|
-
MANAGE_SYSTEM_USERS = "MANAGE_SYSTEM_USERS",
|
|
8
7
|
VIEW_GROUP_OFFICERS = "VIEW_GROUP_OFFICERS",
|
|
9
8
|
MANAGE_GROUP_OFFICERS = "MANAGE_GROUP_OFFICERS",
|
|
10
9
|
VIEW_GROUP_MEMBERS = "VIEW_GROUP_MEMBERS",
|
|
11
|
-
MANAGE_GROUP_MEMBERS = "MANAGE_GROUP_MEMBERS"
|
|
10
|
+
MANAGE_GROUP_MEMBERS = "MANAGE_GROUP_MEMBERS",
|
|
11
|
+
MANAGE_SYSTEM_USERS = "MANAGE_SYSTEM_USERS",
|
|
12
|
+
VIEW_ALL_GROUPS = "VIEW_ALL_GROUPS",
|
|
13
|
+
MANAGE_ALL_GROUPS = "MANAGE_ALL_GROUPS",
|
|
14
|
+
VIEW_ALL_ROSTERS = "VIEW_ALL_ROSTERS",
|
|
15
|
+
MANAGE_ALL_ROSTERS = "MANAGE_ALL_ROSTERS"
|
|
12
16
|
}
|
|
@@ -2,7 +2,20 @@ import { GroupPermission } from '../models/group-permissions.model';
|
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
export declare class GroupPermissionsMapService {
|
|
4
4
|
groupPermissions: GroupPermission[];
|
|
5
|
+
globalGroupPermissions: GroupPermission[];
|
|
6
|
+
/**
|
|
7
|
+
* Returns group-wise permission mappings.
|
|
8
|
+
* @return {GroupPermission[]}
|
|
9
|
+
* @memberof GroupPermissionsMapService
|
|
10
|
+
*/
|
|
5
11
|
getGroupPermissions(): GroupPermission[];
|
|
12
|
+
/**
|
|
13
|
+
* Returns global permissions mapping for groups.
|
|
14
|
+
* Global permissions are maintained separately as global permissions also include role based group wise permissions irrespective of the attached group.
|
|
15
|
+
* @return {GroupPermission[]}
|
|
16
|
+
* @memberof GroupPermissionsMapService
|
|
17
|
+
*/
|
|
18
|
+
getGlobalGroupPermissions(): GroupPermission[];
|
|
6
19
|
static ɵfac: i0.ɵɵFactoryDeclaration<GroupPermissionsMapService, never>;
|
|
7
20
|
static ɵprov: i0.ɵɵInjectableDeclaration<GroupPermissionsMapService>;
|
|
8
21
|
}
|
|
@@ -19,9 +19,10 @@ import { MemberTypeResponse } from '../models/member-type.model';
|
|
|
19
19
|
import { ClassificationResponse } from '../models/classification.model';
|
|
20
20
|
import { GroupRosterType } from '../models/roster-type.model';
|
|
21
21
|
import { FormControlStatus } from '@angular/forms';
|
|
22
|
-
import { GroupPermission } from '../models/group-permissions.model';
|
|
22
|
+
import { GroupPermission, UserPermission } from '../models/group-permissions.model';
|
|
23
23
|
import { PermissionType } from '../models/permission-type.model';
|
|
24
24
|
import { UserPermissionsService } from './user-permissions.service';
|
|
25
|
+
import { GroupPermissionsMapService } from './group-permissions-map-service';
|
|
25
26
|
import { ParentGroupsInfo } from '../models/parent-groups-info.model';
|
|
26
27
|
import * as i0 from "@angular/core";
|
|
27
28
|
/**
|
|
@@ -31,6 +32,7 @@ import * as i0 from "@angular/core";
|
|
|
31
32
|
export declare class GroupsService {
|
|
32
33
|
private httpService;
|
|
33
34
|
private userPermissionsService;
|
|
35
|
+
private groupPermissionsService;
|
|
34
36
|
alertService: AlertsService;
|
|
35
37
|
groupsText: {
|
|
36
38
|
ER1000: string;
|
|
@@ -38,12 +40,7 @@ export declare class GroupsService {
|
|
|
38
40
|
"1001": string;
|
|
39
41
|
"1002": string;
|
|
40
42
|
"1003": string;
|
|
41
|
-
"1004": string;
|
|
42
|
-
* Sets selected group info.
|
|
43
|
-
* @param {(GroupInfo | undefined)} selectedGroupInfo -selected group info.
|
|
44
|
-
* @param {(GroupInfo | undefined)} [selectedGroupParentInfo] -selected parent group info.
|
|
45
|
-
* @memberof GroupsService
|
|
46
|
-
*/
|
|
43
|
+
"1004": string;
|
|
47
44
|
"1005": string;
|
|
48
45
|
"1006": string;
|
|
49
46
|
"1007": string;
|
|
@@ -72,10 +69,17 @@ export declare class GroupsService {
|
|
|
72
69
|
"1030": string;
|
|
73
70
|
"1031": string;
|
|
74
71
|
"1032": string;
|
|
75
|
-
"1033": string;
|
|
72
|
+
"1033": string; /**
|
|
73
|
+
* Gets the group users for the given group id.
|
|
74
|
+
* @param {string} groupId
|
|
75
|
+
* @return {Observable<GetGroupUsersResponse>}
|
|
76
|
+
* @memberof GroupsService
|
|
77
|
+
*/
|
|
76
78
|
"1034": string;
|
|
77
79
|
"1035": string;
|
|
78
80
|
"1036": string;
|
|
81
|
+
"1037": string;
|
|
82
|
+
"1038": string;
|
|
79
83
|
"2001": string;
|
|
80
84
|
"2002": string;
|
|
81
85
|
"2010": string;
|
|
@@ -107,7 +111,7 @@ export declare class GroupsService {
|
|
|
107
111
|
userGroupPermissions: GroupPermission[];
|
|
108
112
|
groupTypes: GroupTypeConfiguration[];
|
|
109
113
|
isParentGroupChanged: boolean;
|
|
110
|
-
constructor(httpService: HttpService, userPermissionsService: UserPermissionsService, alertService: AlertsService);
|
|
114
|
+
constructor(httpService: HttpService, userPermissionsService: UserPermissionsService, groupPermissionsService: GroupPermissionsMapService, alertService: AlertsService);
|
|
111
115
|
setAppConfig(apiBaseUrl: string, userPermission: any): void;
|
|
112
116
|
/**
|
|
113
117
|
* Gets application group types from API and returns it as an observable.
|
|
@@ -337,11 +341,13 @@ export declare class GroupsService {
|
|
|
337
341
|
getUserGroupPermissions(): GroupPermission[];
|
|
338
342
|
/**
|
|
339
343
|
* Validates permission based access for provided feature.
|
|
344
|
+
* Checks for group level permissions, and provides access based on individual group permissions.
|
|
345
|
+
* For global permissions provides access across the individual groups or System groups.
|
|
340
346
|
* @param {PermissionType} permissionType
|
|
341
347
|
* @return {boolean}
|
|
342
348
|
* @memberof GroupsService
|
|
343
349
|
*/
|
|
344
|
-
validateAccess(permissionType: PermissionType): boolean;
|
|
350
|
+
validateAccess(permissionType: PermissionType, permissions?: UserPermission[] | null): boolean;
|
|
345
351
|
/**
|
|
346
352
|
* Store the loaded group types.
|
|
347
353
|
* @param {GroupTypeConfiguration[]} groupTypes
|
|
@@ -19,7 +19,7 @@ export declare class UserPermissionsService {
|
|
|
19
19
|
* @return {GroupPermissions[]}
|
|
20
20
|
* @memberof UserPermissionsService
|
|
21
21
|
*/
|
|
22
|
-
filterUserGroupPermissions(userPermissions: UserPermission[]): GroupPermission[];
|
|
22
|
+
filterUserGroupPermissions(userPermissions: UserPermission[], groupPermissions: GroupPermission[]): GroupPermission[];
|
|
23
23
|
static ɵfac: i0.ɵɵFactoryDeclaration<UserPermissionsService, never>;
|
|
24
24
|
static ɵprov: i0.ɵɵInjectableDeclaration<UserPermissionsService>;
|
|
25
25
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ieeesa-npm/groups",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.3",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^16.1.0",
|
|
6
6
|
"@angular/core": "^16.1.0",
|
|
7
|
-
"@ieeesa-npm/presentation": "^0.
|
|
8
|
-
"@ieeesa-npm/shared-styles": "^0.2.
|
|
9
|
-
"@ieeesa-npm/utility": "^0.9.
|
|
7
|
+
"@ieeesa-npm/presentation": "^0.11.0",
|
|
8
|
+
"@ieeesa-npm/shared-styles": "^0.2.6",
|
|
9
|
+
"@ieeesa-npm/utility": "^0.9.9"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"tslib": "^2.3.0"
|