@ieeesa-npm/groups 0.10.2 → 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.
@@ -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,7 +69,12 @@ 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;
@@ -109,7 +111,7 @@ export declare class GroupsService {
109
111
  userGroupPermissions: GroupPermission[];
110
112
  groupTypes: GroupTypeConfiguration[];
111
113
  isParentGroupChanged: boolean;
112
- constructor(httpService: HttpService, userPermissionsService: UserPermissionsService, alertService: AlertsService);
114
+ constructor(httpService: HttpService, userPermissionsService: UserPermissionsService, groupPermissionsService: GroupPermissionsMapService, alertService: AlertsService);
113
115
  setAppConfig(apiBaseUrl: string, userPermission: any): void;
114
116
  /**
115
117
  * Gets application group types from API and returns it as an observable.
@@ -339,11 +341,13 @@ export declare class GroupsService {
339
341
  getUserGroupPermissions(): GroupPermission[];
340
342
  /**
341
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.
342
346
  * @param {PermissionType} permissionType
343
347
  * @return {boolean}
344
348
  * @memberof GroupsService
345
349
  */
346
- validateAccess(permissionType: PermissionType): boolean;
350
+ validateAccess(permissionType: PermissionType, permissions?: UserPermission[] | null): boolean;
347
351
  /**
348
352
  * Store the loaded group types.
349
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.2",
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.10.9",
7
+ "@ieeesa-npm/presentation": "^0.11.0",
8
8
  "@ieeesa-npm/shared-styles": "^0.2.6",
9
- "@ieeesa-npm/utility": "^0.9.8"
9
+ "@ieeesa-npm/utility": "^0.9.9"
10
10
  },
11
11
  "dependencies": {
12
12
  "tslib": "^2.3.0"