@firestitch/app-acl 12.3.6 → 12.3.7
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/app/components/acl-entries/acl-entries.component.d.ts +33 -33
- package/app/components/acl-entry/acl-entry.component.d.ts +31 -31
- package/app/components/acl-object-roles/acl-object-roles.component.d.ts +18 -18
- package/app/components/acl-permission-popover/acl-permission-popover.component.d.ts +12 -12
- package/app/components/acl-role/acl-role.component.d.ts +46 -46
- package/app/components/acl-role-popover/acl-role-popover.component.d.ts +13 -13
- package/app/components/acl-roles/acl-roles.component.d.ts +35 -35
- package/app/consts/acl-role-accesses.d.ts +5 -5
- package/app/enums/acl-role-access.d.ts +6 -6
- package/app/fs-app-acl.module.d.ts +31 -31
- package/app/injectors/app-acl-config.injector.d.ts +2 -2
- package/app/interfaces/acl-entry-data.d.ts +11 -11
- package/app/interfaces/acl-entry.d.ts +18 -18
- package/app/interfaces/acl-level.d.ts +3 -3
- package/app/interfaces/acl-object-entry.d.ts +11 -11
- package/app/interfaces/acl-object-role.d.ts +6 -6
- package/app/interfaces/acl-object.d.ts +4 -4
- package/app/interfaces/acl-permission.d.ts +7 -7
- package/app/interfaces/acl-role.d.ts +15 -15
- package/app/interfaces/app-acl-config.d.ts +7 -7
- package/app/interfaces/name-value.d.ts +4 -4
- package/app/services/app-acl.service.d.ts +16 -16
- package/bundles/firestitch-app-acl.umd.js +1137 -1134
- package/bundles/firestitch-app-acl.umd.js.map +1 -1
- package/esm2015/app/components/acl-entries/acl-entries.component.js +172 -172
- package/esm2015/app/components/acl-entry/acl-entry.component.js +89 -89
- package/esm2015/app/components/acl-object-roles/acl-object-roles.component.js +56 -56
- package/esm2015/app/components/acl-permission-popover/acl-permission-popover.component.js +32 -32
- package/esm2015/app/components/acl-role/acl-role.component.js +200 -200
- package/esm2015/app/components/acl-role-popover/acl-role-popover.component.js +37 -37
- package/esm2015/app/components/acl-roles/acl-roles.component.js +149 -146
- package/esm2015/app/consts/acl-role-accesses.js +7 -7
- package/esm2015/app/enums/acl-role-access.js +7 -7
- package/esm2015/app/fs-app-acl.module.js +123 -123
- package/esm2015/app/injectors/app-acl-config.injector.js +2 -2
- package/esm2015/app/interfaces/acl-entry-data.js +1 -1
- package/esm2015/app/interfaces/acl-entry.js +1 -1
- package/esm2015/app/interfaces/acl-level.js +1 -1
- package/esm2015/app/interfaces/acl-object-entry.js +1 -1
- package/esm2015/app/interfaces/acl-object-role.js +1 -1
- package/esm2015/app/interfaces/acl-object.js +1 -1
- package/esm2015/app/interfaces/acl-permission.js +1 -1
- package/esm2015/app/interfaces/acl-role.js +1 -1
- package/esm2015/app/interfaces/app-acl-config.js +1 -1
- package/esm2015/app/interfaces/name-value.js +1 -1
- package/esm2015/app/services/app-acl.service.js +50 -50
- package/esm2015/firestitch-app-acl.js +4 -4
- package/esm2015/public_api.js +10 -10
- package/fesm2015/firestitch-app-acl.js +779 -776
- package/fesm2015/firestitch-app-acl.js.map +1 -1
- package/firestitch-app-acl.d.ts +5 -5
- package/package.json +1 -1
- package/public_api.d.ts +20 -20
|
@@ -45,806 +45,809 @@ import * as i17 from '@angular/flex-layout/flex';
|
|
|
45
45
|
import { groupBy, sortBy } from 'lodash-es';
|
|
46
46
|
import * as i3$1 from '@firestitch/prompt';
|
|
47
47
|
|
|
48
|
-
var AclRoleAccess;
|
|
49
|
-
(function (AclRoleAccess) {
|
|
50
|
-
AclRoleAccess[AclRoleAccess["None"] = 0] = "None";
|
|
51
|
-
AclRoleAccess[AclRoleAccess["Read"] = 5] = "Read";
|
|
52
|
-
AclRoleAccess[AclRoleAccess["Write"] = 10] = "Write";
|
|
53
|
-
AclRoleAccess[AclRoleAccess["Full"] = 15] = "Full";
|
|
48
|
+
var AclRoleAccess;
|
|
49
|
+
(function (AclRoleAccess) {
|
|
50
|
+
AclRoleAccess[AclRoleAccess["None"] = 0] = "None";
|
|
51
|
+
AclRoleAccess[AclRoleAccess["Read"] = 5] = "Read";
|
|
52
|
+
AclRoleAccess[AclRoleAccess["Write"] = 10] = "Write";
|
|
53
|
+
AclRoleAccess[AclRoleAccess["Full"] = 15] = "Full";
|
|
54
54
|
})(AclRoleAccess || (AclRoleAccess = {}));
|
|
55
55
|
|
|
56
|
-
const AclRoleAccesses = [
|
|
57
|
-
{ name: 'None', value: AclRoleAccess.None },
|
|
58
|
-
{ name: 'Read', value: AclRoleAccess.Read },
|
|
59
|
-
{ name: 'Write', value: AclRoleAccess.Write },
|
|
60
|
-
{ name: 'Full', value: AclRoleAccess.Full }
|
|
56
|
+
const AclRoleAccesses = [
|
|
57
|
+
{ name: 'None', value: AclRoleAccess.None },
|
|
58
|
+
{ name: 'Read', value: AclRoleAccess.Read },
|
|
59
|
+
{ name: 'Write', value: AclRoleAccess.Write },
|
|
60
|
+
{ name: 'Full', value: AclRoleAccess.Full }
|
|
61
61
|
];
|
|
62
62
|
|
|
63
63
|
const FS_APP_ACL_CONFIG = new InjectionToken('fs-app-acl-config');
|
|
64
64
|
|
|
65
|
-
class FsAppAclService {
|
|
66
|
-
constructor(_appAclConfig) {
|
|
67
|
-
this._appAclConfig = _appAclConfig;
|
|
68
|
-
}
|
|
69
|
-
getPermissions() {
|
|
70
|
-
if (!this._permissions$) {
|
|
71
|
-
this._permissions$ = new ReplaySubject();
|
|
72
|
-
this._appAclConfig.permissions
|
|
73
|
-
.subscribe((permissions) => {
|
|
74
|
-
this._permissions$.next(permissions);
|
|
75
|
-
this._permissions$.complete();
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
return this._permissions$;
|
|
79
|
-
}
|
|
80
|
-
getLevels() {
|
|
81
|
-
if (!this._levels$) {
|
|
82
|
-
this._levels$ = new ReplaySubject();
|
|
83
|
-
this._appAclConfig.levels
|
|
84
|
-
.subscribe((levels) => {
|
|
85
|
-
this._levels$.next(levels);
|
|
86
|
-
this._levels$.complete();
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
return this._levels$;
|
|
90
|
-
}
|
|
91
|
-
getIndexedLevels() {
|
|
92
|
-
return this.getLevels()
|
|
93
|
-
.pipe(map((data) => {
|
|
94
|
-
return list(data, 'name', 'value');
|
|
95
|
-
}));
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
FsAppAclService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAppAclService, deps: [{ token: FS_APP_ACL_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
99
|
-
FsAppAclService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAppAclService, providedIn: 'root' });
|
|
100
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAppAclService, decorators: [{
|
|
101
|
-
type: Injectable,
|
|
102
|
-
args: [{
|
|
103
|
-
providedIn: 'root',
|
|
104
|
-
}]
|
|
105
|
-
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
106
|
-
type: Inject,
|
|
107
|
-
args: [FS_APP_ACL_CONFIG]
|
|
65
|
+
class FsAppAclService {
|
|
66
|
+
constructor(_appAclConfig) {
|
|
67
|
+
this._appAclConfig = _appAclConfig;
|
|
68
|
+
}
|
|
69
|
+
getPermissions() {
|
|
70
|
+
if (!this._permissions$) {
|
|
71
|
+
this._permissions$ = new ReplaySubject();
|
|
72
|
+
this._appAclConfig.permissions
|
|
73
|
+
.subscribe((permissions) => {
|
|
74
|
+
this._permissions$.next(permissions);
|
|
75
|
+
this._permissions$.complete();
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
return this._permissions$;
|
|
79
|
+
}
|
|
80
|
+
getLevels() {
|
|
81
|
+
if (!this._levels$) {
|
|
82
|
+
this._levels$ = new ReplaySubject();
|
|
83
|
+
this._appAclConfig.levels
|
|
84
|
+
.subscribe((levels) => {
|
|
85
|
+
this._levels$.next(levels);
|
|
86
|
+
this._levels$.complete();
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
return this._levels$;
|
|
90
|
+
}
|
|
91
|
+
getIndexedLevels() {
|
|
92
|
+
return this.getLevels()
|
|
93
|
+
.pipe(map((data) => {
|
|
94
|
+
return list(data, 'name', 'value');
|
|
95
|
+
}));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
FsAppAclService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAppAclService, deps: [{ token: FS_APP_ACL_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
99
|
+
FsAppAclService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAppAclService, providedIn: 'root' });
|
|
100
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAppAclService, decorators: [{
|
|
101
|
+
type: Injectable,
|
|
102
|
+
args: [{
|
|
103
|
+
providedIn: 'root',
|
|
104
|
+
}]
|
|
105
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
106
|
+
type: Inject,
|
|
107
|
+
args: [FS_APP_ACL_CONFIG]
|
|
108
108
|
}] }]; } });
|
|
109
109
|
|
|
110
|
-
class FsAclRoleComponent {
|
|
111
|
-
constructor(_data, _appAclService, _dialogRef, _message, _cdRef) {
|
|
112
|
-
this._data = _data;
|
|
113
|
-
this._appAclService = _appAclService;
|
|
114
|
-
this._dialogRef = _dialogRef;
|
|
115
|
-
this._message = _message;
|
|
116
|
-
this._cdRef = _cdRef;
|
|
117
|
-
this.aclRole = null;
|
|
118
|
-
this.permissions = [];
|
|
119
|
-
this.levelPermissions = [];
|
|
120
|
-
this.AclRoleAccesses = AclRoleAccesses;
|
|
121
|
-
this.indexedAccesses = {};
|
|
122
|
-
this.aclLevels = [];
|
|
123
|
-
this.indexedAclLevels = {};
|
|
124
|
-
this.onlyFullAccess = false;
|
|
125
|
-
this.AclLevels = {};
|
|
126
|
-
this.aclRoleConfigs = [];
|
|
127
|
-
this.levelAclRoleConfigs = [];
|
|
128
|
-
this._destroy$ = new Subject();
|
|
129
|
-
this.save = () => {
|
|
130
|
-
const aclRole = Object.assign(Object.assign({}, this.aclRole), { permissions: this.levelPermissions.map((permission) => {
|
|
131
|
-
return {
|
|
132
|
-
value: permission.value,
|
|
133
|
-
access: this.aclRole.permissions[permission.value] || 0,
|
|
134
|
-
};
|
|
135
|
-
}), aclRoleConfigs: this.levelAclRoleConfigs.map((item) => {
|
|
136
|
-
return {
|
|
137
|
-
id: item.id,
|
|
138
|
-
value: item.value,
|
|
139
|
-
data: item.data,
|
|
140
|
-
};
|
|
141
|
-
}) });
|
|
142
|
-
return this._data.saveAclRole(aclRole)
|
|
143
|
-
.pipe(tap((response) => {
|
|
144
|
-
this._message.success('Saved Changes');
|
|
145
|
-
this.close(response);
|
|
146
|
-
}));
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
ngOnInit() {
|
|
150
|
-
forkJoin(this.getRole(), this._appAclService.getPermissions())
|
|
151
|
-
.pipe(takeUntil(this._destroy$))
|
|
152
|
-
.subscribe(([aclRole, aclPermissions,]) => {
|
|
153
|
-
this.permissions = aclPermissions;
|
|
154
|
-
this.aclLevels = this._data.aclLevels;
|
|
155
|
-
this.indexedAclLevels = list(this.aclLevels, 'name', 'value');
|
|
156
|
-
this.indexedAccesses = list(AclRoleAccesses, 'name', 'value');
|
|
157
|
-
this.aclRole = Object.assign({
|
|
158
|
-
aclPermissions: [],
|
|
159
|
-
allPermissions: true,
|
|
160
|
-
aclRoleConfigs: [],
|
|
161
|
-
permissions: {},
|
|
162
|
-
level: this.aclLevels[0].value,
|
|
163
|
-
}, aclRole);
|
|
164
|
-
if (this.aclRole.id) {
|
|
165
|
-
this.permissions.forEach((permission) => {
|
|
166
|
-
let access = 0;
|
|
167
|
-
const aclPermission = this.aclRole.aclPermissions.find((item) => {
|
|
168
|
-
return item.permission === permission.value;
|
|
169
|
-
});
|
|
170
|
-
if (aclPermission) {
|
|
171
|
-
access = aclPermission.access;
|
|
172
|
-
}
|
|
173
|
-
this.aclRole.permissions[permission.value] = access;
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
if (this.aclRole.allPermissions) {
|
|
177
|
-
this._applyMaxPermissionAccess();
|
|
178
|
-
}
|
|
179
|
-
this._updatePermissions();
|
|
180
|
-
this._updateAclRoleConfigs();
|
|
181
|
-
this._cdRef.markForCheck();
|
|
182
|
-
});
|
|
183
|
-
this.listConfig = {
|
|
184
|
-
status: false,
|
|
185
|
-
paging: false,
|
|
186
|
-
noResults: {
|
|
187
|
-
message: '',
|
|
188
|
-
},
|
|
189
|
-
group: {
|
|
190
|
-
initialExpand: true,
|
|
191
|
-
groupBy: (data) => {
|
|
192
|
-
return data;
|
|
193
|
-
},
|
|
194
|
-
compareBy: (data) => {
|
|
195
|
-
return data.category || 'General';
|
|
196
|
-
},
|
|
197
|
-
},
|
|
198
|
-
fetch: () => {
|
|
199
|
-
return of({
|
|
200
|
-
data: this.levelPermissions.sort((a, b) => {
|
|
201
|
-
a = a.name.toUpperCase();
|
|
202
|
-
b = b.name.toUpperCase();
|
|
203
|
-
if (a < b) {
|
|
204
|
-
return -1;
|
|
205
|
-
}
|
|
206
|
-
else if (a > b) {
|
|
207
|
-
return 1;
|
|
208
|
-
}
|
|
209
|
-
return 0;
|
|
210
|
-
}),
|
|
211
|
-
});
|
|
212
|
-
},
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
levelChange() {
|
|
216
|
-
this._updatePermissions();
|
|
217
|
-
this._updateAclRoleConfigs();
|
|
218
|
-
setTimeout(() => {
|
|
219
|
-
this.list.reload();
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
getRole() {
|
|
223
|
-
if (!this._data.aclRole.id) {
|
|
224
|
-
return of(this._data.aclRole);
|
|
225
|
-
}
|
|
226
|
-
const query = {
|
|
227
|
-
aclPermissions: true,
|
|
228
|
-
aclRoleConfigs: true,
|
|
229
|
-
};
|
|
230
|
-
if (!this.environment) {
|
|
231
|
-
query.environmentId = null;
|
|
232
|
-
}
|
|
233
|
-
return this._data.loadAclRole(this._data.aclRole, query);
|
|
234
|
-
}
|
|
235
|
-
close(data = null) {
|
|
236
|
-
this._dialogRef.close(data);
|
|
237
|
-
}
|
|
238
|
-
allPermissionsChange(all) {
|
|
239
|
-
this._updatePermissions();
|
|
240
|
-
if (all) {
|
|
241
|
-
this._applyMaxPermissionAccess();
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
ngOnDestroy() {
|
|
245
|
-
this._destroy$.next();
|
|
246
|
-
this._destroy$.complete();
|
|
247
|
-
}
|
|
248
|
-
_updatePermissions() {
|
|
249
|
-
this.levelPermissions = this.permissions.filter((permission) => {
|
|
250
|
-
return permission.levels.some((item) => {
|
|
251
|
-
return item === this.aclRole.level;
|
|
252
|
-
});
|
|
253
|
-
});
|
|
254
|
-
}
|
|
255
|
-
_updateAclRoleConfigs() {
|
|
256
|
-
this.levelAclRoleConfigs = this.aclRoleConfigs.filter((item) => {
|
|
257
|
-
return this.aclRole.level === item.level;
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
_applyMaxPermissionAccess() {
|
|
261
|
-
this.permissions.forEach((permission) => {
|
|
262
|
-
this.aclRole.permissions[permission.value] = Math.max(...permission.accesses);
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
FsAclRoleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAclRoleComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: FsAppAclService }, { token: i2.MatDialogRef }, { token: i3.FsMessage }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
267
|
-
FsAclRoleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsAclRoleComponent, selector: "ng-component", viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: true }], ngImport: i0, template: "<form fsForm [submit]=\"save\">\n <fs-dialog>\n <ng-container *ngIf=\"aclRole\">\n <div mat-dialog-title>{{ aclRole.id ? 'Edit' : 'Create' }} Role</div>\n <mat-dialog-content>\n <div fxLayout=\"row\" fxLayout.lt-md=\"column\" fxLayoutGap=\"40px\" fxLayoutGap.lt-md=\"0\">\n <div fxLayout=\"column\" fxFlex fxFlex.lt-md=\"0\">\n <mat-form-field>\n <input \n matInput \n placeholder=\"Name\" \n [(ngModel)]=\"aclRole.name\" \n name=\"name\" \n fsFormRequired>\n </mat-form-field>\n\n <mat-form-field>\n <input \n matInput \n placeholder=\"Description\" \n [(ngModel)]=\"aclRole.description\"\n name=\"description\">\n </mat-form-field> \n\n <fs-label-field *ngIf=\"aclRole.id || aclLevels.length === 1; else levels\">\n <fs-label>Level</fs-label>\n {{indexedAclLevels[aclRole.level]}}\n </fs-label-field>\n\n <ng-template #levels>\n <div class=\"level\">\n <fs-radio-group\n [(ngModel)]=\"aclRole.level\"\n (ngModelChange)=\"levelChange()\"\n fsFormRequired\n label=\"Level\"\n orientation=\"vertical\"\n name=\"level\">\n <mat-radio-button\n *ngFor=\"let item of aclLevels\"\n [value]=\"item.value\"\n [disabled]=\"!!aclRole.protected\">\n {{ item.name }}\n </mat-radio-button>\n </fs-radio-group>\n </div>\n </ng-template>\n\n <fs-label-field *ngIf=\"levelPermissions.length\">\n <fs-label>All Permissions</fs-label>\n <mat-checkbox\n [(ngModel)]=\"aclRole.allPermissions\"\n (ngModelChange)=\"allPermissionsChange($event)\"\n [disabled]=\"!!aclRole.protected\"\n name=\"allPermissions\">\n </mat-checkbox>\n </fs-label-field>\n\n <div fxLayout=\"column\" *ngFor=\"let config of levelAclRoleConfigs\">\n <fs-label-field *ngIf=\"config.interface === 'checkbox'\">\n <fs-label>{{config.name}}</fs-label>\n <mat-checkbox\n [(ngModel)]=\"config.data\"\n [name]=\"config.name\">\n </mat-checkbox>\n <fs-label-message>\n <mat-hint>{{config.description}}</mat-hint>\n </fs-label-message>\n </fs-label-field>\n\n <mat-form-field *ngIf=\"config.interface === 'select'\">\n <mat-select\n [(ngModel)]=\"config.data\"\n [name]=\"config.value\"\n [required]=\"config.required\"\n [placeholder]=\"config.name\">\n <mat-option\n *ngFor=\"let item of config.values\"\n [value]=\"item.value\">\n {{ item.name }}\n </mat-option>\n </mat-select>\n <mat-hint>{{config.description}}</mat-hint>\n </mat-form-field>\n </div>\n </div>\n\n <div fxLayout=\"column\" fxFlex=\"65\" fxFlex.lt-md=\"0\" *ngIf=\"aclRole.level\" [hidden]=\"!levelPermissions.length\" class=\"permissions\">\n\n <fs-list [config]=\"listConfig\">\n <fs-list-column title=\"Permissions\">\n <ng-template colspan=\"2\" fs-list-group-cell let-row=\"row\" class=\"permission-group\">\n <small><b>{{row.category || 'General'}}</b></small>\n </ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <div class=\"permission\">{{ row.name }}</div>\n <div class=\"description small\">{{ row.description }}</div>\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Access\" width=\"1%\" class=\"access\">\n <ng-template fs-list-cell let-row=\"permission\" let-permission=\"row\">\n <span *ngIf=\"aclRole.allPermissions; else elseAll\">\n {{ indexedAccesses[aclRole.permissions[permission.value]] }}\n </span>\n <ng-template #elseAll>\n <mat-form-field>\n <mat-select\n [(ngModel)]=\"aclRole.permissions[permission.value]\"\n [disabled]=\"!!aclRole.protected\"\n fsFormRequired\n name=\"access-{{ permission.value }}\">\n <ng-container *ngFor=\"let access of AclRoleAccesses\">\n <mat-option\n *ngIf=\"access.value === 0 || permission.accesses.indexOf(access.value) !== -1\"\n [value]=\"access.value\">\n {{ access.name }}\n </mat-option>\n </ng-container>\n </mat-select>\n </mat-form-field>\n </ng-template>\n </ng-template>\n </fs-list-column>\n </fs-list>\n </div>\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button type=\"submit\" color=\"primary\">{{ aclRole.id ? 'Save' : 'Create' }}</button>\n <button mat-button [mat-dialog-close]=\"null\" type=\"button\">Cancel</button>\n </mat-dialog-actions>\n </ng-container>\n </fs-dialog>\n</form>\n", styles: [":host .permissions ::ng-deep .fs-list-row-group{background-color:#f6f6f6}:host .permissions ::ng-deep fs-list .access{white-space:nowrap}:host .permissions ::ng-deep .mat-form-field{width:100px}:host .permissions ::ng-deep .mat-form-field .mat-form-field-wrapper{padding-bottom:0}:host .permissions ::ng-deep .mat-form-field .mat-form-field-infix{border-top:0}:host .permissions ::ng-deep .mat-form-field .mat-form-field-underline{bottom:0}:host ::ng-deep fs-radio-group{width:100%}:host ::ng-deep fs-label-field{width:100%}:host .level{width:100%}\n"], components: [{ type: i4.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i5.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i6.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i6.FsLabelComponent, selector: "fs-label" }, { type: i7.FsRadioGroupComponent, selector: "fs-radio-group", inputs: ["orientation", "label", "name", "disabled", "radioPosition", "compareWith", "required"] }, { type: i8.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }, { type: i9.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i6.FsLabelMessageComponent, selector: "fs-label-message" }, { type: i10.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i11.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i12.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i13.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i14.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i14.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i14.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i15.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"] }, { type: i7$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i17.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i17.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { type: i17.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { type: i18.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i14.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i15.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { type: i14.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i14.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i7$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { type: i14.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i12.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i12.FsListGroupHeaderDirective, selector: "[fs-list-group-cell],[fs-list-group-header]" }, { type: i12.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { type: i2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i15.FsSubmitButtonDirective, selector: "button[type=\"submit\"]", inputs: ["name", "dirtySubmit"] }, { type: i2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
268
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAclRoleComponent, decorators: [{
|
|
269
|
-
type: Component,
|
|
270
|
-
args: [{
|
|
271
|
-
templateUrl: './acl-role.component.html',
|
|
272
|
-
styleUrls: ['./acl-role.component.scss'],
|
|
273
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
274
|
-
}]
|
|
275
|
-
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
276
|
-
type: Inject,
|
|
277
|
-
args: [MAT_DIALOG_DATA]
|
|
278
|
-
}] }, { type: FsAppAclService }, { type: i2.MatDialogRef }, { type: i3.FsMessage }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { list: [{
|
|
279
|
-
type: ViewChild,
|
|
280
|
-
args: [FsListComponent]
|
|
110
|
+
class FsAclRoleComponent {
|
|
111
|
+
constructor(_data, _appAclService, _dialogRef, _message, _cdRef) {
|
|
112
|
+
this._data = _data;
|
|
113
|
+
this._appAclService = _appAclService;
|
|
114
|
+
this._dialogRef = _dialogRef;
|
|
115
|
+
this._message = _message;
|
|
116
|
+
this._cdRef = _cdRef;
|
|
117
|
+
this.aclRole = null;
|
|
118
|
+
this.permissions = [];
|
|
119
|
+
this.levelPermissions = [];
|
|
120
|
+
this.AclRoleAccesses = AclRoleAccesses;
|
|
121
|
+
this.indexedAccesses = {};
|
|
122
|
+
this.aclLevels = [];
|
|
123
|
+
this.indexedAclLevels = {};
|
|
124
|
+
this.onlyFullAccess = false;
|
|
125
|
+
this.AclLevels = {};
|
|
126
|
+
this.aclRoleConfigs = [];
|
|
127
|
+
this.levelAclRoleConfigs = [];
|
|
128
|
+
this._destroy$ = new Subject();
|
|
129
|
+
this.save = () => {
|
|
130
|
+
const aclRole = Object.assign(Object.assign({}, this.aclRole), { permissions: this.levelPermissions.map((permission) => {
|
|
131
|
+
return {
|
|
132
|
+
value: permission.value,
|
|
133
|
+
access: this.aclRole.permissions[permission.value] || 0,
|
|
134
|
+
};
|
|
135
|
+
}), aclRoleConfigs: this.levelAclRoleConfigs.map((item) => {
|
|
136
|
+
return {
|
|
137
|
+
id: item.id,
|
|
138
|
+
value: item.value,
|
|
139
|
+
data: item.data,
|
|
140
|
+
};
|
|
141
|
+
}) });
|
|
142
|
+
return this._data.saveAclRole(aclRole)
|
|
143
|
+
.pipe(tap((response) => {
|
|
144
|
+
this._message.success('Saved Changes');
|
|
145
|
+
this.close(response);
|
|
146
|
+
}));
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
ngOnInit() {
|
|
150
|
+
forkJoin(this.getRole(), this._appAclService.getPermissions())
|
|
151
|
+
.pipe(takeUntil(this._destroy$))
|
|
152
|
+
.subscribe(([aclRole, aclPermissions,]) => {
|
|
153
|
+
this.permissions = aclPermissions;
|
|
154
|
+
this.aclLevels = this._data.aclLevels;
|
|
155
|
+
this.indexedAclLevels = list(this.aclLevels, 'name', 'value');
|
|
156
|
+
this.indexedAccesses = list(AclRoleAccesses, 'name', 'value');
|
|
157
|
+
this.aclRole = Object.assign({
|
|
158
|
+
aclPermissions: [],
|
|
159
|
+
allPermissions: true,
|
|
160
|
+
aclRoleConfigs: [],
|
|
161
|
+
permissions: {},
|
|
162
|
+
level: this.aclLevels[0].value,
|
|
163
|
+
}, aclRole);
|
|
164
|
+
if (this.aclRole.id) {
|
|
165
|
+
this.permissions.forEach((permission) => {
|
|
166
|
+
let access = 0;
|
|
167
|
+
const aclPermission = this.aclRole.aclPermissions.find((item) => {
|
|
168
|
+
return item.permission === permission.value;
|
|
169
|
+
});
|
|
170
|
+
if (aclPermission) {
|
|
171
|
+
access = aclPermission.access;
|
|
172
|
+
}
|
|
173
|
+
this.aclRole.permissions[permission.value] = access;
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
if (this.aclRole.allPermissions) {
|
|
177
|
+
this._applyMaxPermissionAccess();
|
|
178
|
+
}
|
|
179
|
+
this._updatePermissions();
|
|
180
|
+
this._updateAclRoleConfigs();
|
|
181
|
+
this._cdRef.markForCheck();
|
|
182
|
+
});
|
|
183
|
+
this.listConfig = {
|
|
184
|
+
status: false,
|
|
185
|
+
paging: false,
|
|
186
|
+
noResults: {
|
|
187
|
+
message: '',
|
|
188
|
+
},
|
|
189
|
+
group: {
|
|
190
|
+
initialExpand: true,
|
|
191
|
+
groupBy: (data) => {
|
|
192
|
+
return data;
|
|
193
|
+
},
|
|
194
|
+
compareBy: (data) => {
|
|
195
|
+
return data.category || 'General';
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
fetch: () => {
|
|
199
|
+
return of({
|
|
200
|
+
data: this.levelPermissions.sort((a, b) => {
|
|
201
|
+
a = a.name.toUpperCase();
|
|
202
|
+
b = b.name.toUpperCase();
|
|
203
|
+
if (a < b) {
|
|
204
|
+
return -1;
|
|
205
|
+
}
|
|
206
|
+
else if (a > b) {
|
|
207
|
+
return 1;
|
|
208
|
+
}
|
|
209
|
+
return 0;
|
|
210
|
+
}),
|
|
211
|
+
});
|
|
212
|
+
},
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
levelChange() {
|
|
216
|
+
this._updatePermissions();
|
|
217
|
+
this._updateAclRoleConfigs();
|
|
218
|
+
setTimeout(() => {
|
|
219
|
+
this.list.reload();
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
getRole() {
|
|
223
|
+
if (!this._data.aclRole.id) {
|
|
224
|
+
return of(this._data.aclRole);
|
|
225
|
+
}
|
|
226
|
+
const query = {
|
|
227
|
+
aclPermissions: true,
|
|
228
|
+
aclRoleConfigs: true,
|
|
229
|
+
};
|
|
230
|
+
if (!this.environment) {
|
|
231
|
+
query.environmentId = null;
|
|
232
|
+
}
|
|
233
|
+
return this._data.loadAclRole(this._data.aclRole, query);
|
|
234
|
+
}
|
|
235
|
+
close(data = null) {
|
|
236
|
+
this._dialogRef.close(data);
|
|
237
|
+
}
|
|
238
|
+
allPermissionsChange(all) {
|
|
239
|
+
this._updatePermissions();
|
|
240
|
+
if (all) {
|
|
241
|
+
this._applyMaxPermissionAccess();
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
ngOnDestroy() {
|
|
245
|
+
this._destroy$.next();
|
|
246
|
+
this._destroy$.complete();
|
|
247
|
+
}
|
|
248
|
+
_updatePermissions() {
|
|
249
|
+
this.levelPermissions = this.permissions.filter((permission) => {
|
|
250
|
+
return permission.levels.some((item) => {
|
|
251
|
+
return item === this.aclRole.level;
|
|
252
|
+
});
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
_updateAclRoleConfigs() {
|
|
256
|
+
this.levelAclRoleConfigs = this.aclRoleConfigs.filter((item) => {
|
|
257
|
+
return this.aclRole.level === item.level;
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
_applyMaxPermissionAccess() {
|
|
261
|
+
this.permissions.forEach((permission) => {
|
|
262
|
+
this.aclRole.permissions[permission.value] = Math.max(...permission.accesses);
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
FsAclRoleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAclRoleComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: FsAppAclService }, { token: i2.MatDialogRef }, { token: i3.FsMessage }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
267
|
+
FsAclRoleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsAclRoleComponent, selector: "ng-component", viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: true }], ngImport: i0, template: "<form fsForm [submit]=\"save\">\n <fs-dialog>\n <ng-container *ngIf=\"aclRole\">\n <div mat-dialog-title>{{ aclRole.id ? 'Edit' : 'Create' }} Role</div>\n <mat-dialog-content>\n <div fxLayout=\"row\" fxLayout.lt-md=\"column\" fxLayoutGap=\"40px\" fxLayoutGap.lt-md=\"0\">\n <div fxLayout=\"column\" fxFlex fxFlex.lt-md=\"0\">\n <mat-form-field>\n <input \n matInput \n placeholder=\"Name\" \n [(ngModel)]=\"aclRole.name\" \n name=\"name\" \n fsFormRequired>\n </mat-form-field>\n\n <mat-form-field>\n <input \n matInput \n placeholder=\"Description\" \n [(ngModel)]=\"aclRole.description\"\n name=\"description\">\n </mat-form-field> \n\n <fs-label-field *ngIf=\"aclRole.id || aclLevels.length === 1; else levels\">\n <fs-label>Level</fs-label>\n {{indexedAclLevels[aclRole.level]}}\n </fs-label-field>\n\n <ng-template #levels>\n <div class=\"level\">\n <fs-radio-group\n [(ngModel)]=\"aclRole.level\"\n (ngModelChange)=\"levelChange()\"\n fsFormRequired\n label=\"Level\"\n orientation=\"vertical\"\n name=\"level\">\n <mat-radio-button\n *ngFor=\"let item of aclLevels\"\n [value]=\"item.value\"\n [disabled]=\"!!aclRole.protected\">\n {{ item.name }}\n </mat-radio-button>\n </fs-radio-group>\n </div>\n </ng-template>\n\n <fs-label-field *ngIf=\"levelPermissions.length\">\n <fs-label>All Permissions</fs-label>\n <mat-checkbox\n [(ngModel)]=\"aclRole.allPermissions\"\n (ngModelChange)=\"allPermissionsChange($event)\"\n [disabled]=\"!!aclRole.protected\"\n name=\"allPermissions\">\n </mat-checkbox>\n </fs-label-field>\n\n <div fxLayout=\"column\" *ngFor=\"let config of levelAclRoleConfigs\">\n <fs-label-field *ngIf=\"config.interface === 'checkbox'\">\n <fs-label>{{config.name}}</fs-label>\n <mat-checkbox\n [(ngModel)]=\"config.data\"\n [name]=\"config.name\">\n </mat-checkbox>\n <fs-label-message>\n <mat-hint>{{config.description}}</mat-hint>\n </fs-label-message>\n </fs-label-field>\n\n <mat-form-field *ngIf=\"config.interface === 'select'\">\n <mat-select\n [(ngModel)]=\"config.data\"\n [name]=\"config.value\"\n [required]=\"config.required\"\n [placeholder]=\"config.name\">\n <mat-option\n *ngFor=\"let item of config.values\"\n [value]=\"item.value\">\n {{ item.name }}\n </mat-option>\n </mat-select>\n <mat-hint>{{config.description}}</mat-hint>\n </mat-form-field>\n </div>\n </div>\n\n <div fxLayout=\"column\" fxFlex=\"65\" fxFlex.lt-md=\"0\" *ngIf=\"aclRole.level\" [hidden]=\"!levelPermissions.length\" class=\"permissions\">\n\n <fs-list [config]=\"listConfig\">\n <fs-list-column title=\"Permissions\">\n <ng-template colspan=\"2\" fs-list-group-cell let-row=\"row\" class=\"permission-group\">\n <small><b>{{row.category || 'General'}}</b></small>\n </ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <div class=\"permission\">{{ row.name }}</div>\n <div class=\"description small\">{{ row.description }}</div>\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Access\" width=\"1%\" class=\"access\">\n <ng-template fs-list-cell let-row=\"permission\" let-permission=\"row\">\n <span *ngIf=\"aclRole.allPermissions; else elseAll\">\n {{ indexedAccesses[aclRole.permissions[permission.value]] }}\n </span>\n <ng-template #elseAll>\n <mat-form-field>\n <mat-select\n [(ngModel)]=\"aclRole.permissions[permission.value]\"\n [disabled]=\"!!aclRole.protected\"\n fsFormRequired\n name=\"access-{{ permission.value }}\">\n <ng-container *ngFor=\"let access of AclRoleAccesses\">\n <mat-option\n *ngIf=\"access.value === 0 || permission.accesses.indexOf(access.value) !== -1\"\n [value]=\"access.value\">\n {{ access.name }}\n </mat-option>\n </ng-container>\n </mat-select>\n </mat-form-field>\n </ng-template>\n </ng-template>\n </fs-list-column>\n </fs-list>\n </div>\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button type=\"submit\" color=\"primary\">{{ aclRole.id ? 'Save' : 'Create' }}</button>\n <button mat-button [mat-dialog-close]=\"null\" type=\"button\">Cancel</button>\n </mat-dialog-actions>\n </ng-container>\n </fs-dialog>\n</form>\n", styles: [":host .permissions ::ng-deep .fs-list-row-group{background-color:#f6f6f6}:host .permissions ::ng-deep fs-list .access{white-space:nowrap}:host .permissions ::ng-deep .mat-form-field{width:100px}:host .permissions ::ng-deep .mat-form-field .mat-form-field-wrapper{padding-bottom:0}:host .permissions ::ng-deep .mat-form-field .mat-form-field-infix{border-top:0}:host .permissions ::ng-deep .mat-form-field .mat-form-field-underline{bottom:0}:host ::ng-deep fs-radio-group{width:100%}:host ::ng-deep fs-label-field{width:100%}:host .level{width:100%}\n"], components: [{ type: i4.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i5.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i6.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i6.FsLabelComponent, selector: "fs-label" }, { type: i7.FsRadioGroupComponent, selector: "fs-radio-group", inputs: ["orientation", "label", "name", "disabled", "radioPosition", "compareWith", "required"] }, { type: i8.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }, { type: i9.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i6.FsLabelMessageComponent, selector: "fs-label-message" }, { type: i10.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i11.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i12.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i13.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i14.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i14.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i14.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i15.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"] }, { type: i7$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i17.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i17.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { type: i17.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { type: i18.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i14.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i15.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { type: i14.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i14.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i7$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { type: i14.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i12.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i12.FsListGroupHeaderDirective, selector: "[fs-list-group-cell],[fs-list-group-header]" }, { type: i12.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { type: i2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i15.FsSubmitButtonDirective, selector: "button[type=\"submit\"]", inputs: ["name", "dirtySubmit"] }, { type: i2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
268
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAclRoleComponent, decorators: [{
|
|
269
|
+
type: Component,
|
|
270
|
+
args: [{
|
|
271
|
+
templateUrl: './acl-role.component.html',
|
|
272
|
+
styleUrls: ['./acl-role.component.scss'],
|
|
273
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
274
|
+
}]
|
|
275
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
276
|
+
type: Inject,
|
|
277
|
+
args: [MAT_DIALOG_DATA]
|
|
278
|
+
}] }, { type: FsAppAclService }, { type: i2.MatDialogRef }, { type: i3.FsMessage }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { list: [{
|
|
279
|
+
type: ViewChild,
|
|
280
|
+
args: [FsListComponent]
|
|
281
281
|
}] } });
|
|
282
282
|
|
|
283
|
-
class FsAclPermissionPopoverComponent {
|
|
284
|
-
constructor(_appAclService) {
|
|
285
|
-
this._appAclService = _appAclService;
|
|
286
|
-
}
|
|
287
|
-
ngOnInit() {
|
|
288
|
-
this._appAclService.getPermissions()
|
|
289
|
-
.subscribe(permissions => {
|
|
290
|
-
this.description = permissions.filter(item => {
|
|
291
|
-
return item.value === this.permission.value;
|
|
292
|
-
}).map(item => {
|
|
293
|
-
return item.description;
|
|
294
|
-
})[0];
|
|
295
|
-
});
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
FsAclPermissionPopoverComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAclPermissionPopoverComponent, deps: [{ token: FsAppAclService }], target: i0.ɵɵFactoryTarget.Component });
|
|
299
|
-
FsAclPermissionPopoverComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsAclPermissionPopoverComponent, selector: "acl-permission-popover", inputs: { permission: "permission" }, ngImport: i0, template: "\n<fs-popover [template]=\"popover\" maxWidth=\"400\">\n <ng-content></ng-content>\n</fs-popover>\n\n<ng-template #popover>\n {{permission.name}}\n <div class=\"small\">{{description}}</div>\n</ng-template>\n\n", styles: [":host{cursor:pointer}\n"], components: [{ type: i2$1.FsPopoverComponent, selector: "fs-popover", inputs: ["template", "data", "leaveDelay", "showDelay", "maxWidth", "wrapperClass", "autoShow", "autoClose", "loadingDiameter", "loading", "indication", "position", "theme", "size", "trigger"] }] });
|
|
300
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAclPermissionPopoverComponent, decorators: [{
|
|
301
|
-
type: Component,
|
|
302
|
-
args: [{
|
|
303
|
-
selector: 'acl-permission-popover',
|
|
304
|
-
templateUrl: './acl-permission-popover.component.html',
|
|
305
|
-
styleUrls: ['./acl-permission-popover.component.scss']
|
|
306
|
-
}]
|
|
307
|
-
}], ctorParameters: function () { return [{ type: FsAppAclService }]; }, propDecorators: { permission: [{
|
|
308
|
-
type: Input
|
|
283
|
+
class FsAclPermissionPopoverComponent {
|
|
284
|
+
constructor(_appAclService) {
|
|
285
|
+
this._appAclService = _appAclService;
|
|
286
|
+
}
|
|
287
|
+
ngOnInit() {
|
|
288
|
+
this._appAclService.getPermissions()
|
|
289
|
+
.subscribe(permissions => {
|
|
290
|
+
this.description = permissions.filter(item => {
|
|
291
|
+
return item.value === this.permission.value;
|
|
292
|
+
}).map(item => {
|
|
293
|
+
return item.description;
|
|
294
|
+
})[0];
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
FsAclPermissionPopoverComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAclPermissionPopoverComponent, deps: [{ token: FsAppAclService }], target: i0.ɵɵFactoryTarget.Component });
|
|
299
|
+
FsAclPermissionPopoverComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsAclPermissionPopoverComponent, selector: "acl-permission-popover", inputs: { permission: "permission" }, ngImport: i0, template: "\n<fs-popover [template]=\"popover\" maxWidth=\"400\">\n <ng-content></ng-content>\n</fs-popover>\n\n<ng-template #popover>\n {{permission.name}}\n <div class=\"small\">{{description}}</div>\n</ng-template>\n\n", styles: [":host{cursor:pointer}\n"], components: [{ type: i2$1.FsPopoverComponent, selector: "fs-popover", inputs: ["template", "data", "leaveDelay", "showDelay", "maxWidth", "wrapperClass", "autoShow", "autoClose", "loadingDiameter", "loading", "indication", "position", "theme", "size", "trigger"] }] });
|
|
300
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAclPermissionPopoverComponent, decorators: [{
|
|
301
|
+
type: Component,
|
|
302
|
+
args: [{
|
|
303
|
+
selector: 'acl-permission-popover',
|
|
304
|
+
templateUrl: './acl-permission-popover.component.html',
|
|
305
|
+
styleUrls: ['./acl-permission-popover.component.scss']
|
|
306
|
+
}]
|
|
307
|
+
}], ctorParameters: function () { return [{ type: FsAppAclService }]; }, propDecorators: { permission: [{
|
|
308
|
+
type: Input
|
|
309
309
|
}] } });
|
|
310
310
|
|
|
311
|
-
class FsAclRolesComponent {
|
|
312
|
-
constructor(_appAclService, _dialog, _cdRef) {
|
|
313
|
-
this._appAclService = _appAclService;
|
|
314
|
-
this._dialog = _dialog;
|
|
315
|
-
this._cdRef = _cdRef;
|
|
316
|
-
this.aclLevels = [];
|
|
317
|
-
this.list = new QueryList();
|
|
318
|
-
this.indexedAclRoleLevels = {};
|
|
319
|
-
this._destroy$ = new Subject();
|
|
320
|
-
}
|
|
321
|
-
ngOnInit() {
|
|
322
|
-
new Observable(observer => {
|
|
323
|
-
if (this.aclLevels.length) {
|
|
324
|
-
observer.next(this.aclLevels);
|
|
325
|
-
observer.complete();
|
|
326
|
-
}
|
|
327
|
-
else {
|
|
328
|
-
this._appAclService.getLevels()
|
|
329
|
-
.subscribe((aclLevels) => {
|
|
330
|
-
observer.next(aclLevels);
|
|
331
|
-
observer.complete();
|
|
332
|
-
});
|
|
333
|
-
}
|
|
334
|
-
})
|
|
335
|
-
.subscribe((aclLevels) => {
|
|
336
|
-
this.aclLevels = aclLevels;
|
|
337
|
-
this.indexedAclRoleLevels = list(this.aclLevels, 'name', 'value');
|
|
338
|
-
this._loadListConfig();
|
|
339
|
-
});
|
|
340
|
-
}
|
|
341
|
-
openDialog(aclRole = { id: null }) {
|
|
342
|
-
const dialogRef = this._dialog.open(FsAclRoleComponent, {
|
|
343
|
-
width: '70%',
|
|
344
|
-
data: {
|
|
345
|
-
aclRole,
|
|
346
|
-
aclLevels: this.aclLevels,
|
|
347
|
-
loadAclRole: this.loadAclRole,
|
|
348
|
-
saveAclRole: this.saveAclRole,
|
|
349
|
-
},
|
|
350
|
-
});
|
|
351
|
-
dialogRef.afterClosed()
|
|
352
|
-
.pipe(takeUntil(this._destroy$), filter((response) => !!response))
|
|
353
|
-
.subscribe((response) => {
|
|
354
|
-
this.list.forEach((list) => {
|
|
355
|
-
list.reload();
|
|
356
|
-
});
|
|
357
|
-
});
|
|
358
|
-
}
|
|
359
|
-
ngOnDestroy() {
|
|
360
|
-
this._destroy$.next();
|
|
361
|
-
this._destroy$.complete();
|
|
362
|
-
}
|
|
363
|
-
_loadListConfig() {
|
|
364
|
-
this.listConfig = {
|
|
365
|
-
sort: { value: 'hierarchy' },
|
|
366
|
-
|
|
367
|
-
{
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
311
|
+
class FsAclRolesComponent {
|
|
312
|
+
constructor(_appAclService, _dialog, _cdRef) {
|
|
313
|
+
this._appAclService = _appAclService;
|
|
314
|
+
this._dialog = _dialog;
|
|
315
|
+
this._cdRef = _cdRef;
|
|
316
|
+
this.aclLevels = [];
|
|
317
|
+
this.list = new QueryList();
|
|
318
|
+
this.indexedAclRoleLevels = {};
|
|
319
|
+
this._destroy$ = new Subject();
|
|
320
|
+
}
|
|
321
|
+
ngOnInit() {
|
|
322
|
+
new Observable(observer => {
|
|
323
|
+
if (this.aclLevels.length) {
|
|
324
|
+
observer.next(this.aclLevels);
|
|
325
|
+
observer.complete();
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
this._appAclService.getLevels()
|
|
329
|
+
.subscribe((aclLevels) => {
|
|
330
|
+
observer.next(aclLevels);
|
|
331
|
+
observer.complete();
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
})
|
|
335
|
+
.subscribe((aclLevels) => {
|
|
336
|
+
this.aclLevels = aclLevels;
|
|
337
|
+
this.indexedAclRoleLevels = list(this.aclLevels, 'name', 'value');
|
|
338
|
+
this._loadListConfig();
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
openDialog(aclRole = { id: null }) {
|
|
342
|
+
const dialogRef = this._dialog.open(FsAclRoleComponent, {
|
|
343
|
+
width: '70%',
|
|
344
|
+
data: {
|
|
345
|
+
aclRole,
|
|
346
|
+
aclLevels: this.aclLevels,
|
|
347
|
+
loadAclRole: this.loadAclRole,
|
|
348
|
+
saveAclRole: this.saveAclRole,
|
|
349
|
+
},
|
|
350
|
+
});
|
|
351
|
+
dialogRef.afterClosed()
|
|
352
|
+
.pipe(takeUntil(this._destroy$), filter((response) => !!response))
|
|
353
|
+
.subscribe((response) => {
|
|
354
|
+
this.list.forEach((list) => {
|
|
355
|
+
list.reload();
|
|
356
|
+
});
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
ngOnDestroy() {
|
|
360
|
+
this._destroy$.next();
|
|
361
|
+
this._destroy$.complete();
|
|
362
|
+
}
|
|
363
|
+
_loadListConfig() {
|
|
364
|
+
this.listConfig = {
|
|
365
|
+
sort: { value: 'hierarchy' },
|
|
366
|
+
sorts: [
|
|
367
|
+
{ name: 'Hierarchy', value: 'hierarchy' }
|
|
368
|
+
],
|
|
369
|
+
filters: [
|
|
370
|
+
{
|
|
371
|
+
name: 'keyword',
|
|
372
|
+
type: ItemType.Keyword,
|
|
373
|
+
label: 'Search',
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
name: 'level',
|
|
377
|
+
label: 'Level',
|
|
378
|
+
type: ItemType.Select,
|
|
379
|
+
values: this.aclLevels,
|
|
380
|
+
hide: this.aclLevels.length <= 1
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
name: 'state',
|
|
384
|
+
label: 'Show Deleted',
|
|
385
|
+
type: ItemType.Checkbox,
|
|
386
|
+
unchecked: 'active',
|
|
387
|
+
checked: 'deleted',
|
|
388
|
+
},
|
|
389
|
+
],
|
|
390
|
+
actions: [
|
|
391
|
+
{
|
|
392
|
+
click: (event) => {
|
|
393
|
+
this.openDialog();
|
|
394
|
+
},
|
|
395
|
+
label: 'Create',
|
|
396
|
+
},
|
|
397
|
+
],
|
|
398
|
+
rowActions: [
|
|
399
|
+
{
|
|
400
|
+
click: (data) => {
|
|
401
|
+
return this.deleteAclRole(data);
|
|
402
|
+
},
|
|
403
|
+
remove: {
|
|
404
|
+
title: 'Confirm',
|
|
405
|
+
template: 'Are you sure you would like to delete this role?',
|
|
406
|
+
},
|
|
407
|
+
menu: true,
|
|
408
|
+
label: 'Delete',
|
|
409
|
+
show: (row) => row.state !== 'deleted',
|
|
410
|
+
},
|
|
411
|
+
],
|
|
412
|
+
fetch: (query) => {
|
|
413
|
+
query.permissions = true;
|
|
414
|
+
return this.loadAclRoles(query)
|
|
415
|
+
.pipe(map((data) => data));
|
|
416
|
+
},
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
FsAclRolesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAclRolesComponent, deps: [{ token: FsAppAclService }, { token: i2.MatDialog }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
421
|
+
FsAclRolesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsAclRolesComponent, selector: "fs-acl-roles", inputs: { deleteAclRole: "deleteAclRole", saveAclRole: "saveAclRole", loadAclRoles: "loadAclRoles", loadAclRole: "loadAclRole", aclLevels: "aclLevels" }, viewQueries: [{ propertyName: "list", predicate: FsListComponent, descendants: true }], ngImport: i0, template: "<fs-list [config]=\"listConfig\" *ngIf=\"listConfig\">\n <fs-list-column title=\"Name\" name=\"name\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.state !== 'deleted' else deletedRole\">\n <a (click)=\"openDialog(row)\">{{ row.name }}</a>\n </ng-container>\n <ng-template #deletedRole>\n {{ row.name }}\n </ng-template>\n <div class=\"small\">{{row.description}}</div>\n </ng-template>\n </fs-list-column>\n <fs-list-column name=\"hierarchy\" title=\"Level\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n {{ indexedAclRoleLevels[row.level] }}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Permissions\">\n <ng-template fs-list-cell let-row=\"row\">\n <div class=\"permissions\">\n <ng-container *ngFor=\"let permission of row.permissions\">\n <span *ngIf=\"permission.access\" class=\"permission\">\n <acl-permission-popover [permission]=\"permission\">{{permission.name}}</acl-permission-popover>\n </span>\n </ng-container>\n </div>\n </ng-template>\n </fs-list-column>\n</fs-list>\n", styles: [".permissions .permission+.permission:before{content:\", \"}\n"], components: [{ type: i12.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: FsAclPermissionPopoverComponent, selector: "acl-permission-popover", inputs: ["permission"] }], directives: [{ type: i7$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i12.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i12.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { type: i7$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
422
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAclRolesComponent, decorators: [{
|
|
423
|
+
type: Component,
|
|
424
|
+
args: [{
|
|
425
|
+
selector: 'fs-acl-roles',
|
|
426
|
+
templateUrl: 'acl-roles.component.html',
|
|
427
|
+
styleUrls: ['acl-roles.component.scss'],
|
|
428
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
429
|
+
}]
|
|
430
|
+
}], ctorParameters: function () { return [{ type: FsAppAclService }, { type: i2.MatDialog }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { deleteAclRole: [{
|
|
431
|
+
type: Input
|
|
432
|
+
}], saveAclRole: [{
|
|
433
|
+
type: Input
|
|
434
|
+
}], loadAclRoles: [{
|
|
435
|
+
type: Input
|
|
436
|
+
}], loadAclRole: [{
|
|
437
|
+
type: Input
|
|
438
|
+
}], aclLevels: [{
|
|
439
|
+
type: Input
|
|
440
|
+
}], list: [{
|
|
441
|
+
type: ViewChildren,
|
|
442
|
+
args: [FsListComponent]
|
|
440
443
|
}] } });
|
|
441
444
|
|
|
442
|
-
class FsAclRolePopoverComponent {
|
|
443
|
-
constructor(_appAclService) {
|
|
444
|
-
this._appAclService = _appAclService;
|
|
445
|
-
this.permissions = [];
|
|
446
|
-
}
|
|
447
|
-
ngOnInit() {
|
|
448
|
-
const aclRolePermissions = this.aclRole.permissions || [];
|
|
449
|
-
this._appAclService.getPermissions()
|
|
450
|
-
.subscribe((response) => {
|
|
451
|
-
this.permissions = response.filter(item => {
|
|
452
|
-
return aclRolePermissions.some(permission => {
|
|
453
|
-
return item.value === permission.value;
|
|
454
|
-
});
|
|
455
|
-
});
|
|
456
|
-
});
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
FsAclRolePopoverComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAclRolePopoverComponent, deps: [{ token: FsAppAclService }], target: i0.ɵɵFactoryTarget.Component });
|
|
460
|
-
FsAclRolePopoverComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsAclRolePopoverComponent, selector: "fs-acl-role-popover", inputs: { aclRole: "aclRole", objectName: "objectName" }, ngImport: i0, template: "\n<fs-popover [template]=\"popover\" maxWidth=\"400\">\n <ng-content></ng-content>\n</fs-popover>\n\n<ng-template #popover>\n <div class=\"name small\">{{aclRole.name}}<span *ngIf=\"objectName\">: {{objectName}}</span></div>\n\n <ng-container *ngIf=\"permissions.length; else nonePermission\">\n <div *ngFor=\"let permission of permissions\" class=\"permission\">\n <div>{{permission.name}}</div>\n <div class=\"small\">{{permission.description}}</div>\n </div>\n </ng-container>\n\n <ng-template #nonePermission>\n None\n </ng-template>\n</ng-template>\n", styles: [".name{padding-bottom:10px}.permission+.permission{padding-top:5px}:host{cursor:pointer}\n"], components: [{ type: i2$1.FsPopoverComponent, selector: "fs-popover", inputs: ["template", "data", "leaveDelay", "showDelay", "maxWidth", "wrapperClass", "autoShow", "autoClose", "loadingDiameter", "loading", "indication", "position", "theme", "size", "trigger"] }], directives: [{ type: i7$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
461
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAclRolePopoverComponent, decorators: [{
|
|
462
|
-
type: Component,
|
|
463
|
-
args: [{
|
|
464
|
-
selector: 'fs-acl-role-popover',
|
|
465
|
-
templateUrl: './acl-role-popover.component.html',
|
|
466
|
-
styleUrls: ['./acl-role-popover.component.scss']
|
|
467
|
-
}]
|
|
468
|
-
}], ctorParameters: function () { return [{ type: FsAppAclService }]; }, propDecorators: { aclRole: [{
|
|
469
|
-
type: Input
|
|
470
|
-
}], objectName: [{
|
|
471
|
-
type: Input
|
|
445
|
+
class FsAclRolePopoverComponent {
|
|
446
|
+
constructor(_appAclService) {
|
|
447
|
+
this._appAclService = _appAclService;
|
|
448
|
+
this.permissions = [];
|
|
449
|
+
}
|
|
450
|
+
ngOnInit() {
|
|
451
|
+
const aclRolePermissions = this.aclRole.permissions || [];
|
|
452
|
+
this._appAclService.getPermissions()
|
|
453
|
+
.subscribe((response) => {
|
|
454
|
+
this.permissions = response.filter(item => {
|
|
455
|
+
return aclRolePermissions.some(permission => {
|
|
456
|
+
return item.value === permission.value;
|
|
457
|
+
});
|
|
458
|
+
});
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
FsAclRolePopoverComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAclRolePopoverComponent, deps: [{ token: FsAppAclService }], target: i0.ɵɵFactoryTarget.Component });
|
|
463
|
+
FsAclRolePopoverComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsAclRolePopoverComponent, selector: "fs-acl-role-popover", inputs: { aclRole: "aclRole", objectName: "objectName" }, ngImport: i0, template: "\n<fs-popover [template]=\"popover\" maxWidth=\"400\">\n <ng-content></ng-content>\n</fs-popover>\n\n<ng-template #popover>\n <div class=\"name small\">{{aclRole.name}}<span *ngIf=\"objectName\">: {{objectName}}</span></div>\n\n <ng-container *ngIf=\"permissions.length; else nonePermission\">\n <div *ngFor=\"let permission of permissions\" class=\"permission\">\n <div>{{permission.name}}</div>\n <div class=\"small\">{{permission.description}}</div>\n </div>\n </ng-container>\n\n <ng-template #nonePermission>\n None\n </ng-template>\n</ng-template>\n", styles: [".name{padding-bottom:10px}.permission+.permission{padding-top:5px}:host{cursor:pointer}\n"], components: [{ type: i2$1.FsPopoverComponent, selector: "fs-popover", inputs: ["template", "data", "leaveDelay", "showDelay", "maxWidth", "wrapperClass", "autoShow", "autoClose", "loadingDiameter", "loading", "indication", "position", "theme", "size", "trigger"] }], directives: [{ type: i7$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
464
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAclRolePopoverComponent, decorators: [{
|
|
465
|
+
type: Component,
|
|
466
|
+
args: [{
|
|
467
|
+
selector: 'fs-acl-role-popover',
|
|
468
|
+
templateUrl: './acl-role-popover.component.html',
|
|
469
|
+
styleUrls: ['./acl-role-popover.component.scss']
|
|
470
|
+
}]
|
|
471
|
+
}], ctorParameters: function () { return [{ type: FsAppAclService }]; }, propDecorators: { aclRole: [{
|
|
472
|
+
type: Input
|
|
473
|
+
}], objectName: [{
|
|
474
|
+
type: Input
|
|
472
475
|
}] } });
|
|
473
476
|
|
|
474
|
-
class FsAclObjectRolesComponent {
|
|
475
|
-
constructor() {
|
|
476
|
-
this.aclRoles = [];
|
|
477
|
-
this.required = false;
|
|
478
|
-
this.multiple = false;
|
|
479
|
-
this.disabled = false;
|
|
480
|
-
this.aclObjectRoles = [];
|
|
481
|
-
this.rolesLabel = 'Roles';
|
|
482
|
-
this.levelLabel = '';
|
|
483
|
-
this.change = new EventEmitter();
|
|
484
|
-
this.compareAclRole = (o1, o2) => {
|
|
485
|
-
return o1 && o2 && o1.id === o2.id;
|
|
486
|
-
};
|
|
487
|
-
}
|
|
488
|
-
changed() {
|
|
489
|
-
this.change.emit(this.aclObjectRoles);
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
FsAclObjectRolesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAclObjectRolesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
493
|
-
FsAclObjectRolesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsAclObjectRolesComponent, selector: "fs-acl-object-roles", inputs: { aclRoles: "aclRoles", required: "required", multiple: "multiple", disabled: "disabled", aclObjectRoles: "aclObjectRoles", rolesLabel: "rolesLabel", levelLabel: "levelLabel" }, outputs: { change: "change" }, ngImport: i0, template: "<ng-container *ngIf=\"!multiple\">\n <ng-container *ngFor=\"let aclObjectRole of aclObjectRoles\">\n <fs-checkbox-group\n [(ngModel)]=\"aclObjectRole.aclRoles\"\n (ngModelChange)=\"changed()\"\n name=\"roles\"\n [compareWith]=\"compareAclRole\"\n [disabled]=\"disabled\"\n [label]=\"rolesLabel\"\n [fsFormRequired]=\"required\"\n orientation=\"vertical\">\n <mat-checkbox [disabled]=\"disabled\" *ngFor=\"let aclRole of aclRoles\" [value]=\"aclRole\">\n {{ aclRole.name }}\n </mat-checkbox>\n </fs-checkbox-group>\n </ng-container>\n</ng-container>\n\n<ng-container *ngIf=\"multiple\">\n <table>\n <tr>\n <td>\n <small>{{levelLabel}}</small>\n </td>\n <td>\n <small>{{rolesLabel}}</small>\n </td>\n </tr>\n <tr *ngFor=\"let aclObjectRole of aclObjectRoles\">\n <td>{{aclObjectRole.object.name}}</td>\n <td>\n <mat-form-field class=\"form-field-padless\">\n <mat-select\n [(ngModel)]=\"aclObjectRole.aclRoles\"\n multiple=\"true\"\n [disabled]=\"disabled\"\n [compareWith]=\"compareAclRole\"\n (ngModelChange)=\"changed()\"\n name=\"aclRole_{{ aclObjectRole.object.id }}\">\n <mat-option *ngFor=\"let aclRole of aclRoles\" [value]=\"aclRole\">\n {{ aclRole.name }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </td>\n </tr>\n </table>\n</ng-container>\n", styles: ["table tr td:first-child{padding-right:15px}\n"], components: [{ type: i1.FsCheckboxGroupComponent, selector: "fs-checkbox-group", inputs: ["orientation", "position", "label", "disabled", "compareWith"], outputs: ["change"] }, { type: i9.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i5.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i10.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i11.MatOption, selector: "mat-option", exportAs: ["matOption"] }], directives: [{ type: i7$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i14.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i14.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i15.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }], viewProviders: [{ provide: ControlContainer, useExisting: NgForm }] });
|
|
494
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAclObjectRolesComponent, decorators: [{
|
|
495
|
-
type: Component,
|
|
496
|
-
args: [{
|
|
497
|
-
selector: 'fs-acl-object-roles',
|
|
498
|
-
templateUrl: './acl-object-roles.component.html',
|
|
499
|
-
styleUrls: ['./acl-object-roles.component.scss'],
|
|
500
|
-
viewProviders: [{ provide: ControlContainer, useExisting: NgForm }]
|
|
501
|
-
}]
|
|
502
|
-
}], propDecorators: { aclRoles: [{
|
|
503
|
-
type: Input
|
|
504
|
-
}], required: [{
|
|
505
|
-
type: Input
|
|
506
|
-
}], multiple: [{
|
|
507
|
-
type: Input
|
|
508
|
-
}], disabled: [{
|
|
509
|
-
type: Input
|
|
510
|
-
}], aclObjectRoles: [{
|
|
511
|
-
type: Input
|
|
512
|
-
}], rolesLabel: [{
|
|
513
|
-
type: Input
|
|
514
|
-
}], levelLabel: [{
|
|
515
|
-
type: Input
|
|
516
|
-
}], change: [{
|
|
517
|
-
type: Output
|
|
477
|
+
class FsAclObjectRolesComponent {
|
|
478
|
+
constructor() {
|
|
479
|
+
this.aclRoles = [];
|
|
480
|
+
this.required = false;
|
|
481
|
+
this.multiple = false;
|
|
482
|
+
this.disabled = false;
|
|
483
|
+
this.aclObjectRoles = [];
|
|
484
|
+
this.rolesLabel = 'Roles';
|
|
485
|
+
this.levelLabel = '';
|
|
486
|
+
this.change = new EventEmitter();
|
|
487
|
+
this.compareAclRole = (o1, o2) => {
|
|
488
|
+
return o1 && o2 && o1.id === o2.id;
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
changed() {
|
|
492
|
+
this.change.emit(this.aclObjectRoles);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
FsAclObjectRolesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAclObjectRolesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
496
|
+
FsAclObjectRolesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsAclObjectRolesComponent, selector: "fs-acl-object-roles", inputs: { aclRoles: "aclRoles", required: "required", multiple: "multiple", disabled: "disabled", aclObjectRoles: "aclObjectRoles", rolesLabel: "rolesLabel", levelLabel: "levelLabel" }, outputs: { change: "change" }, ngImport: i0, template: "<ng-container *ngIf=\"!multiple\">\n <ng-container *ngFor=\"let aclObjectRole of aclObjectRoles\">\n <fs-checkbox-group\n [(ngModel)]=\"aclObjectRole.aclRoles\"\n (ngModelChange)=\"changed()\"\n name=\"roles\"\n [compareWith]=\"compareAclRole\"\n [disabled]=\"disabled\"\n [label]=\"rolesLabel\"\n [fsFormRequired]=\"required\"\n orientation=\"vertical\">\n <mat-checkbox [disabled]=\"disabled\" *ngFor=\"let aclRole of aclRoles\" [value]=\"aclRole\">\n {{ aclRole.name }}\n </mat-checkbox>\n </fs-checkbox-group>\n </ng-container>\n</ng-container>\n\n<ng-container *ngIf=\"multiple\">\n <table>\n <tr>\n <td>\n <small>{{levelLabel}}</small>\n </td>\n <td>\n <small>{{rolesLabel}}</small>\n </td>\n </tr>\n <tr *ngFor=\"let aclObjectRole of aclObjectRoles\">\n <td>{{aclObjectRole.object.name}}</td>\n <td>\n <mat-form-field class=\"form-field-padless\">\n <mat-select\n [(ngModel)]=\"aclObjectRole.aclRoles\"\n multiple=\"true\"\n [disabled]=\"disabled\"\n [compareWith]=\"compareAclRole\"\n (ngModelChange)=\"changed()\"\n name=\"aclRole_{{ aclObjectRole.object.id }}\">\n <mat-option *ngFor=\"let aclRole of aclRoles\" [value]=\"aclRole\">\n {{ aclRole.name }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </td>\n </tr>\n </table>\n</ng-container>\n", styles: ["table tr td:first-child{padding-right:15px}\n"], components: [{ type: i1.FsCheckboxGroupComponent, selector: "fs-checkbox-group", inputs: ["orientation", "position", "label", "disabled", "compareWith"], outputs: ["change"] }, { type: i9.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i5.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i10.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i11.MatOption, selector: "mat-option", exportAs: ["matOption"] }], directives: [{ type: i7$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i14.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i14.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i15.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }], viewProviders: [{ provide: ControlContainer, useExisting: NgForm }] });
|
|
497
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAclObjectRolesComponent, decorators: [{
|
|
498
|
+
type: Component,
|
|
499
|
+
args: [{
|
|
500
|
+
selector: 'fs-acl-object-roles',
|
|
501
|
+
templateUrl: './acl-object-roles.component.html',
|
|
502
|
+
styleUrls: ['./acl-object-roles.component.scss'],
|
|
503
|
+
viewProviders: [{ provide: ControlContainer, useExisting: NgForm }]
|
|
504
|
+
}]
|
|
505
|
+
}], propDecorators: { aclRoles: [{
|
|
506
|
+
type: Input
|
|
507
|
+
}], required: [{
|
|
508
|
+
type: Input
|
|
509
|
+
}], multiple: [{
|
|
510
|
+
type: Input
|
|
511
|
+
}], disabled: [{
|
|
512
|
+
type: Input
|
|
513
|
+
}], aclObjectRoles: [{
|
|
514
|
+
type: Input
|
|
515
|
+
}], rolesLabel: [{
|
|
516
|
+
type: Input
|
|
517
|
+
}], levelLabel: [{
|
|
518
|
+
type: Input
|
|
519
|
+
}], change: [{
|
|
520
|
+
type: Output
|
|
518
521
|
}] } });
|
|
519
522
|
|
|
520
|
-
class FsAclEntryComponent {
|
|
521
|
-
constructor(_appAclService, _dialogRef, _message, _data) {
|
|
522
|
-
var _a;
|
|
523
|
-
this._appAclService = _appAclService;
|
|
524
|
-
this._dialogRef = _dialogRef;
|
|
525
|
-
this._message = _message;
|
|
526
|
-
this._data = _data;
|
|
527
|
-
this.aclRoles = [];
|
|
528
|
-
this.aclEntries = [];
|
|
529
|
-
this.indexedAclRoleLevels = {};
|
|
530
|
-
this.titleEdit = 'Edit Roles';
|
|
531
|
-
this.titleAdd = 'Assign Roles';
|
|
532
|
-
this.required = true;
|
|
533
|
-
this.save = () => {
|
|
534
|
-
const aclObjectEntry = Object.assign(Object.assign({}, this.aclObjectEntry), { aclEntries: this.aclEntries });
|
|
535
|
-
return this._data.saveAclObjectEntry(aclObjectEntry)
|
|
536
|
-
.subscribe((data) => {
|
|
537
|
-
this._message.success('Saved Changes');
|
|
538
|
-
this.close(data);
|
|
539
|
-
});
|
|
540
|
-
};
|
|
541
|
-
this.aclObjectEntry = Object.assign({}, _data.aclObjectEntry);
|
|
542
|
-
this.required = (_a = _data.required) !== null && _a !== void 0 ? _a : true;
|
|
543
|
-
if (_data.titleEdit) {
|
|
544
|
-
this.titleEdit = _data.titleEdit;
|
|
545
|
-
}
|
|
546
|
-
if (_data.titleAdd) {
|
|
547
|
-
this.titleAdd = _data.titleAdd;
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
ngOnInit() {
|
|
551
|
-
forkJoin(this._data.loadAclRoles(this.aclObjectEntry), this._appAclService.getIndexedLevels())
|
|
552
|
-
.subscribe(([aclRoles, levels,]) => {
|
|
553
|
-
this.aclRoles = aclRoles;
|
|
554
|
-
this.indexedAclRoleLevels = levels;
|
|
555
|
-
this.aclObjectRole = {
|
|
556
|
-
object: this.aclObjectEntry.object,
|
|
557
|
-
aclRoles: this.aclObjectEntry.aclEntries
|
|
558
|
-
.map((aclEntry) => {
|
|
559
|
-
return aclEntry.aclRole;
|
|
560
|
-
}),
|
|
561
|
-
};
|
|
562
|
-
});
|
|
563
|
-
}
|
|
564
|
-
aclObjectRoleChange(aclObjectRoles) {
|
|
565
|
-
this.aclEntries = aclObjectRoles.reduce((aclEntries, aclObjectRole) => {
|
|
566
|
-
aclObjectRole.aclRoles.forEach(aclRole => {
|
|
567
|
-
aclEntries.push({
|
|
568
|
-
aclRoleId: aclRole.id,
|
|
569
|
-
aclRole: aclRole,
|
|
570
|
-
objectId: aclObjectRole.object ? aclObjectRole.object.id : null,
|
|
571
|
-
object: aclObjectRole.object || null
|
|
572
|
-
});
|
|
573
|
-
});
|
|
574
|
-
return aclEntries;
|
|
575
|
-
}, []);
|
|
576
|
-
}
|
|
577
|
-
close(data = null) {
|
|
578
|
-
this._dialogRef.close(data);
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
FsAclEntryComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAclEntryComponent, deps: [{ token: FsAppAclService }, { token: i2.MatDialogRef }, { token: i3.FsMessage }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
582
|
-
FsAclEntryComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsAclEntryComponent, selector: "ng-component", ngImport: i0, template: "<form fsForm [submit]=\"save\">\n <fs-dialog>\n <div mat-dialog-title>{{ titleEdit? titleEdit : titleAdd }}</div>\n <mat-dialog-content>\n <div *ngIf=\"aclObjectRole\">\n <fs-label-field *ngIf=\"aclObjectEntry.object\">\n <fs-label>{{indexedAclRoleLevels[aclObjectEntry.level]}}</fs-label>\n {{aclObjectEntry.object.name}}\n </fs-label-field>\n\n <fs-acl-object-roles\n [aclRoles]=\"aclRoles\"\n [aclObjectRoles]=\"[aclObjectRole]\"\n [required]=\"required\"\n (change)=\"aclObjectRoleChange($event)\">\n </fs-acl-object-roles>\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button type=\"submit\" color=\"primary\">Save</button>\n <button mat-button mat-dialog-close type=\"button\">Cancel</button>\n </mat-dialog-actions>\n </fs-dialog>\n</form>\n", styles: ["::ng-deep .account-roles-autocomplete-panel .mat-option{line-height:normal}::ng-deep .account-roles-autocomplete-panel .mat-option .mat-option-text{display:flex;flex-direction:row;align-items:center}::ng-deep .account-roles-autocomplete-panel .mat-option .mat-option-text fs-badge{margin-right:5px}\n"], components: [{ type: i4.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i6.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i6.FsLabelComponent, selector: "fs-label" }, { type: FsAclObjectRolesComponent, selector: "fs-acl-object-roles", inputs: ["aclRoles", "required", "multiple", "disabled", "aclObjectRoles", "rolesLabel", "levelLabel"], outputs: ["change"] }, { type: i13.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i14.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i14.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i14.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i15.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"] }, { type: i2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i7$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i15.FsSubmitButtonDirective, selector: "button[type=\"submit\"]", inputs: ["name", "dirtySubmit"] }, { type: i2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }] });
|
|
583
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAclEntryComponent, decorators: [{
|
|
584
|
-
type: Component,
|
|
585
|
-
args: [{
|
|
586
|
-
templateUrl: './acl-entry.component.html',
|
|
587
|
-
styleUrls: ['./acl-entry.component.scss'],
|
|
588
|
-
}]
|
|
589
|
-
}], ctorParameters: function () { return [{ type: FsAppAclService }, { type: i2.MatDialogRef }, { type: i3.FsMessage }, { type: undefined, decorators: [{
|
|
590
|
-
type: Inject,
|
|
591
|
-
args: [MAT_DIALOG_DATA]
|
|
523
|
+
class FsAclEntryComponent {
|
|
524
|
+
constructor(_appAclService, _dialogRef, _message, _data) {
|
|
525
|
+
var _a;
|
|
526
|
+
this._appAclService = _appAclService;
|
|
527
|
+
this._dialogRef = _dialogRef;
|
|
528
|
+
this._message = _message;
|
|
529
|
+
this._data = _data;
|
|
530
|
+
this.aclRoles = [];
|
|
531
|
+
this.aclEntries = [];
|
|
532
|
+
this.indexedAclRoleLevels = {};
|
|
533
|
+
this.titleEdit = 'Edit Roles';
|
|
534
|
+
this.titleAdd = 'Assign Roles';
|
|
535
|
+
this.required = true;
|
|
536
|
+
this.save = () => {
|
|
537
|
+
const aclObjectEntry = Object.assign(Object.assign({}, this.aclObjectEntry), { aclEntries: this.aclEntries });
|
|
538
|
+
return this._data.saveAclObjectEntry(aclObjectEntry)
|
|
539
|
+
.subscribe((data) => {
|
|
540
|
+
this._message.success('Saved Changes');
|
|
541
|
+
this.close(data);
|
|
542
|
+
});
|
|
543
|
+
};
|
|
544
|
+
this.aclObjectEntry = Object.assign({}, _data.aclObjectEntry);
|
|
545
|
+
this.required = (_a = _data.required) !== null && _a !== void 0 ? _a : true;
|
|
546
|
+
if (_data.titleEdit) {
|
|
547
|
+
this.titleEdit = _data.titleEdit;
|
|
548
|
+
}
|
|
549
|
+
if (_data.titleAdd) {
|
|
550
|
+
this.titleAdd = _data.titleAdd;
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
ngOnInit() {
|
|
554
|
+
forkJoin(this._data.loadAclRoles(this.aclObjectEntry), this._appAclService.getIndexedLevels())
|
|
555
|
+
.subscribe(([aclRoles, levels,]) => {
|
|
556
|
+
this.aclRoles = aclRoles;
|
|
557
|
+
this.indexedAclRoleLevels = levels;
|
|
558
|
+
this.aclObjectRole = {
|
|
559
|
+
object: this.aclObjectEntry.object,
|
|
560
|
+
aclRoles: this.aclObjectEntry.aclEntries
|
|
561
|
+
.map((aclEntry) => {
|
|
562
|
+
return aclEntry.aclRole;
|
|
563
|
+
}),
|
|
564
|
+
};
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
aclObjectRoleChange(aclObjectRoles) {
|
|
568
|
+
this.aclEntries = aclObjectRoles.reduce((aclEntries, aclObjectRole) => {
|
|
569
|
+
aclObjectRole.aclRoles.forEach(aclRole => {
|
|
570
|
+
aclEntries.push({
|
|
571
|
+
aclRoleId: aclRole.id,
|
|
572
|
+
aclRole: aclRole,
|
|
573
|
+
objectId: aclObjectRole.object ? aclObjectRole.object.id : null,
|
|
574
|
+
object: aclObjectRole.object || null
|
|
575
|
+
});
|
|
576
|
+
});
|
|
577
|
+
return aclEntries;
|
|
578
|
+
}, []);
|
|
579
|
+
}
|
|
580
|
+
close(data = null) {
|
|
581
|
+
this._dialogRef.close(data);
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
FsAclEntryComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAclEntryComponent, deps: [{ token: FsAppAclService }, { token: i2.MatDialogRef }, { token: i3.FsMessage }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
585
|
+
FsAclEntryComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsAclEntryComponent, selector: "ng-component", ngImport: i0, template: "<form fsForm [submit]=\"save\">\n <fs-dialog>\n <div mat-dialog-title>{{ titleEdit? titleEdit : titleAdd }}</div>\n <mat-dialog-content>\n <div *ngIf=\"aclObjectRole\">\n <fs-label-field *ngIf=\"aclObjectEntry.object\">\n <fs-label>{{indexedAclRoleLevels[aclObjectEntry.level]}}</fs-label>\n {{aclObjectEntry.object.name}}\n </fs-label-field>\n\n <fs-acl-object-roles\n [aclRoles]=\"aclRoles\"\n [aclObjectRoles]=\"[aclObjectRole]\"\n [required]=\"required\"\n (change)=\"aclObjectRoleChange($event)\">\n </fs-acl-object-roles>\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button type=\"submit\" color=\"primary\">Save</button>\n <button mat-button mat-dialog-close type=\"button\">Cancel</button>\n </mat-dialog-actions>\n </fs-dialog>\n</form>\n", styles: ["::ng-deep .account-roles-autocomplete-panel .mat-option{line-height:normal}::ng-deep .account-roles-autocomplete-panel .mat-option .mat-option-text{display:flex;flex-direction:row;align-items:center}::ng-deep .account-roles-autocomplete-panel .mat-option .mat-option-text fs-badge{margin-right:5px}\n"], components: [{ type: i4.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i6.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i6.FsLabelComponent, selector: "fs-label" }, { type: FsAclObjectRolesComponent, selector: "fs-acl-object-roles", inputs: ["aclRoles", "required", "multiple", "disabled", "aclObjectRoles", "rolesLabel", "levelLabel"], outputs: ["change"] }, { type: i13.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i14.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i14.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i14.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i15.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"] }, { type: i2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i7$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i15.FsSubmitButtonDirective, selector: "button[type=\"submit\"]", inputs: ["name", "dirtySubmit"] }, { type: i2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }] });
|
|
586
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAclEntryComponent, decorators: [{
|
|
587
|
+
type: Component,
|
|
588
|
+
args: [{
|
|
589
|
+
templateUrl: './acl-entry.component.html',
|
|
590
|
+
styleUrls: ['./acl-entry.component.scss'],
|
|
591
|
+
}]
|
|
592
|
+
}], ctorParameters: function () { return [{ type: FsAppAclService }, { type: i2.MatDialogRef }, { type: i3.FsMessage }, { type: undefined, decorators: [{
|
|
593
|
+
type: Inject,
|
|
594
|
+
args: [MAT_DIALOG_DATA]
|
|
592
595
|
}] }]; } });
|
|
593
596
|
|
|
594
|
-
class FsAclEntriesComponent {
|
|
595
|
-
constructor(_appAclService, _dialog, _confirm) {
|
|
596
|
-
this._appAclService = _appAclService;
|
|
597
|
-
this._dialog = _dialog;
|
|
598
|
-
this._confirm = _confirm;
|
|
599
|
-
this.environmentShow = true;
|
|
600
|
-
this.environmentLabel = 'Environment';
|
|
601
|
-
this.environmentKey = 'environment';
|
|
602
|
-
this.actions = [];
|
|
603
|
-
this.aclEntriesList = null;
|
|
604
|
-
this.aclEntriesConfig = null;
|
|
605
|
-
this.permissions = [];
|
|
606
|
-
this._destroy$ = new Subject();
|
|
607
|
-
}
|
|
608
|
-
ngOnInit() {
|
|
609
|
-
this._appAclService.getPermissions()
|
|
610
|
-
.subscribe(response => {
|
|
611
|
-
this.permissions = response;
|
|
612
|
-
});
|
|
613
|
-
this.aclEntriesConfig = {
|
|
614
|
-
status: false,
|
|
615
|
-
paging: false,
|
|
616
|
-
actions: this.actions,
|
|
617
|
-
rowActions: [
|
|
618
|
-
{
|
|
619
|
-
label: 'Remove All Roles',
|
|
620
|
-
click: (aclObjectEntry) => {
|
|
621
|
-
this._confirm
|
|
622
|
-
.confirm({
|
|
623
|
-
title: 'Remove All Roles',
|
|
624
|
-
template: 'Are you sure you would like to remove all roles?',
|
|
625
|
-
}).subscribe(() => {
|
|
626
|
-
const data = Object.assign(Object.assign({}, aclObjectEntry), { aclEntries: [] });
|
|
627
|
-
this.saveAclObjectEntry(data)
|
|
628
|
-
.subscribe(() => {
|
|
629
|
-
this.aclEntriesList.reload();
|
|
630
|
-
});
|
|
631
|
-
});
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
|
-
],
|
|
635
|
-
fetch: () => {
|
|
636
|
-
return new Observable((observer) => {
|
|
637
|
-
this.loadAclEntries({
|
|
638
|
-
aclRoles: true,
|
|
639
|
-
aclRolePermissions: true,
|
|
640
|
-
objects: true,
|
|
641
|
-
aclRoleState: 'active',
|
|
642
|
-
})
|
|
643
|
-
.subscribe((aclEntries) => {
|
|
644
|
-
const objects = aclEntries
|
|
645
|
-
.filter((aclEntry) => (!!aclEntry.object))
|
|
646
|
-
.reduce((items, item) => {
|
|
647
|
-
return Object.assign(Object.assign({}, items), { [item.object.id]: item.object });
|
|
648
|
-
}, {});
|
|
649
|
-
const environments = aclEntries
|
|
650
|
-
.filter((aclEntry) => (!!aclEntry[this.environmentKey]))
|
|
651
|
-
.reduce((items, item) => {
|
|
652
|
-
const environment = item[this.environmentKey];
|
|
653
|
-
return Object.assign(Object.assign({}, items), { [environment.id]: environment });
|
|
654
|
-
}, {});
|
|
655
|
-
const groupedAclEntries = groupBy(aclEntries, (item) => {
|
|
656
|
-
var _a;
|
|
657
|
-
const environmentId = (_a = (item[this.environmentKey])) === null || _a === void 0 ? void 0 : _a.id;
|
|
658
|
-
return [item.aclRole.level, environmentId, item.objectId];
|
|
659
|
-
});
|
|
660
|
-
let aclObjectEntries = Object.keys(groupedAclEntries)
|
|
661
|
-
.reduce((accum, key) => {
|
|
662
|
-
const parts = key.split(',');
|
|
663
|
-
return [
|
|
664
|
-
...accum,
|
|
665
|
-
{
|
|
666
|
-
object: objects[parts[2]],
|
|
667
|
-
level: parts[0],
|
|
668
|
-
[`${this.environmentKey}Id`]: parts[1] ? parseInt(parts[1]) : null,
|
|
669
|
-
[this.environmentKey]: environments[parts[1]],
|
|
670
|
-
aclEntries: groupedAclEntries[key],
|
|
671
|
-
}
|
|
672
|
-
];
|
|
673
|
-
}, []);
|
|
674
|
-
const hasApp = aclObjectEntries.some((item) => {
|
|
675
|
-
return item.aclEntries.some((entry) => {
|
|
676
|
-
return !entry.objectId;
|
|
677
|
-
});
|
|
678
|
-
});
|
|
679
|
-
if (!hasApp) {
|
|
680
|
-
aclObjectEntries.unshift({
|
|
681
|
-
object: null,
|
|
682
|
-
aclEntries: [],
|
|
683
|
-
level: 'app',
|
|
684
|
-
environmentId: null,
|
|
685
|
-
});
|
|
686
|
-
}
|
|
687
|
-
aclObjectEntries = sortBy(aclObjectEntries, (item) => {
|
|
688
|
-
return item.object ? item.level : '';
|
|
689
|
-
});
|
|
690
|
-
observer.next({ data: aclObjectEntries });
|
|
691
|
-
observer.complete();
|
|
692
|
-
});
|
|
693
|
-
});
|
|
694
|
-
},
|
|
695
|
-
};
|
|
696
|
-
}
|
|
697
|
-
update(aclObjectEntry) {
|
|
698
|
-
const data = {
|
|
699
|
-
aclObjectEntry,
|
|
700
|
-
required: false,
|
|
701
|
-
loadAclRoles: this.loadAclRoles,
|
|
702
|
-
saveAclObjectEntry: this.saveAclObjectEntry
|
|
703
|
-
};
|
|
704
|
-
this._dialog.open(FsAclEntryComponent, {
|
|
705
|
-
data: data
|
|
706
|
-
})
|
|
707
|
-
.afterClosed()
|
|
708
|
-
.pipe(takeUntil(this._destroy$))
|
|
709
|
-
.subscribe(() => {
|
|
710
|
-
this.aclEntriesList.reload();
|
|
711
|
-
});
|
|
712
|
-
}
|
|
713
|
-
ngOnDestroy() {
|
|
714
|
-
this._destroy$.next();
|
|
715
|
-
this._destroy$.complete();
|
|
716
|
-
}
|
|
717
|
-
reload() {
|
|
718
|
-
this.aclEntriesList.reload();
|
|
719
|
-
}
|
|
720
|
-
}
|
|
721
|
-
FsAclEntriesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAclEntriesComponent, deps: [{ token: FsAppAclService }, { token: i2.MatDialog }, { token: i3$1.FsPrompt }], target: i0.ɵɵFactoryTarget.Component });
|
|
722
|
-
FsAclEntriesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsAclEntriesComponent, selector: "fs-acl-entries", inputs: { loadAclEntries: "loadAclEntries", loadAclRoles: "loadAclRoles", saveAclObjectEntry: "saveAclObjectEntry", environmentShow: "environmentShow", environmentLabel: "environmentLabel", environmentKey: "environmentKey", actions: "actions" }, viewQueries: [{ propertyName: "aclEntriesList", first: true, predicate: FsListComponent, descendants: true }], ngImport: i0, template: "\n<fs-list [config]=\"aclEntriesConfig\">\n <fs-list-column>\n <ng-template fs-list-header>Context</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <div\n *ngIf=\"row.object; else elseObject\"\n fxLayout=\"row\"\n fxLayoutAlign=\"start center\"\n fxLayoutGap=\"10px\">\n <fs-badge *ngIf=\"row.object.imageUrl\" shape=\"circle\" image=\"{{ row.object.imageUrl }}\"></fs-badge>\n <span>\n <div><small>{{ row.object.className }}</small></div>\n <a (click)=\"update(row)\">{{ row.object.name }}</a>\n </span>\n </div>\n\n <ng-template #elseObject>\n <a (click)=\"update(row)\">App</a>\n </ng-template>\n </ng-template>\n </fs-list-column>\n\n <fs-list-column [show]=\"environmentShow\">\n <ng-template fs-list-header>{{environmentLabel}}</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n {{row.environment?.name}}\n </ng-template>\n </fs-list-column>\n\n <fs-list-column>\n <ng-template fs-list-header>Roles</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <div fxLayout=\"column\" fxLayoutGap=\"10px\">\n <div div *ngFor=\"let aclEntry of row.aclEntries\">\n <ng-container [ngSwitch]=\"row.level\">\n <ng-container *ngSwitchCase=\"'app'\">\n <fs-acl-role-popover [aclRole]=\"aclEntry.aclRole\" objectName=\"App\">{{aclEntry.aclRole.name}}</fs-acl-role-popover>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container *ngIf=\"row.object\">\n <fs-acl-role-popover [aclRole]=\"aclEntry.aclRole\">{{aclEntry.aclRole.name}}</fs-acl-role-popover>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n </ng-template>\n </fs-list-column>\n</fs-list>\n", styles: [""], components: [{ type: i12.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i5$1.FsBadgeComponent, selector: "fs-badge", inputs: ["color", "text", "tooltip", "size", "shape", "image", "icon", "iconSize", "iconColor", "backgroundSize"] }, { type: FsAclRolePopoverComponent, selector: "fs-acl-role-popover", inputs: ["aclRole", "objectName"] }], directives: [{ type: i12.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i12.FsListHeaderDirective, selector: "[fs-list-header]", inputs: ["colspan", "align", "class"] }, { type: i12.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { type: i7$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i17.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i17.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { type: i17.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { type: i7$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i7$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i7$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }] });
|
|
723
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAclEntriesComponent, decorators: [{
|
|
724
|
-
type: Component,
|
|
725
|
-
args: [{
|
|
726
|
-
selector: 'fs-acl-entries',
|
|
727
|
-
templateUrl: './acl-entries.component.html',
|
|
728
|
-
styleUrls: ['./acl-entries.component.scss']
|
|
729
|
-
}]
|
|
730
|
-
}], ctorParameters: function () { return [{ type: FsAppAclService }, { type: i2.MatDialog }, { type: i3$1.FsPrompt }]; }, propDecorators: { loadAclEntries: [{
|
|
731
|
-
type: Input
|
|
732
|
-
}], loadAclRoles: [{
|
|
733
|
-
type: Input
|
|
734
|
-
}], saveAclObjectEntry: [{
|
|
735
|
-
type: Input
|
|
736
|
-
}], environmentShow: [{
|
|
737
|
-
type: Input
|
|
738
|
-
}], environmentLabel: [{
|
|
739
|
-
type: Input
|
|
740
|
-
}], environmentKey: [{
|
|
741
|
-
type: Input
|
|
742
|
-
}], actions: [{
|
|
743
|
-
type: Input
|
|
744
|
-
}], aclEntriesList: [{
|
|
745
|
-
type: ViewChild,
|
|
746
|
-
args: [FsListComponent]
|
|
597
|
+
class FsAclEntriesComponent {
|
|
598
|
+
constructor(_appAclService, _dialog, _confirm) {
|
|
599
|
+
this._appAclService = _appAclService;
|
|
600
|
+
this._dialog = _dialog;
|
|
601
|
+
this._confirm = _confirm;
|
|
602
|
+
this.environmentShow = true;
|
|
603
|
+
this.environmentLabel = 'Environment';
|
|
604
|
+
this.environmentKey = 'environment';
|
|
605
|
+
this.actions = [];
|
|
606
|
+
this.aclEntriesList = null;
|
|
607
|
+
this.aclEntriesConfig = null;
|
|
608
|
+
this.permissions = [];
|
|
609
|
+
this._destroy$ = new Subject();
|
|
610
|
+
}
|
|
611
|
+
ngOnInit() {
|
|
612
|
+
this._appAclService.getPermissions()
|
|
613
|
+
.subscribe(response => {
|
|
614
|
+
this.permissions = response;
|
|
615
|
+
});
|
|
616
|
+
this.aclEntriesConfig = {
|
|
617
|
+
status: false,
|
|
618
|
+
paging: false,
|
|
619
|
+
actions: this.actions,
|
|
620
|
+
rowActions: [
|
|
621
|
+
{
|
|
622
|
+
label: 'Remove All Roles',
|
|
623
|
+
click: (aclObjectEntry) => {
|
|
624
|
+
this._confirm
|
|
625
|
+
.confirm({
|
|
626
|
+
title: 'Remove All Roles',
|
|
627
|
+
template: 'Are you sure you would like to remove all roles?',
|
|
628
|
+
}).subscribe(() => {
|
|
629
|
+
const data = Object.assign(Object.assign({}, aclObjectEntry), { aclEntries: [] });
|
|
630
|
+
this.saveAclObjectEntry(data)
|
|
631
|
+
.subscribe(() => {
|
|
632
|
+
this.aclEntriesList.reload();
|
|
633
|
+
});
|
|
634
|
+
});
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
],
|
|
638
|
+
fetch: () => {
|
|
639
|
+
return new Observable((observer) => {
|
|
640
|
+
this.loadAclEntries({
|
|
641
|
+
aclRoles: true,
|
|
642
|
+
aclRolePermissions: true,
|
|
643
|
+
objects: true,
|
|
644
|
+
aclRoleState: 'active',
|
|
645
|
+
})
|
|
646
|
+
.subscribe((aclEntries) => {
|
|
647
|
+
const objects = aclEntries
|
|
648
|
+
.filter((aclEntry) => (!!aclEntry.object))
|
|
649
|
+
.reduce((items, item) => {
|
|
650
|
+
return Object.assign(Object.assign({}, items), { [item.object.id]: item.object });
|
|
651
|
+
}, {});
|
|
652
|
+
const environments = aclEntries
|
|
653
|
+
.filter((aclEntry) => (!!aclEntry[this.environmentKey]))
|
|
654
|
+
.reduce((items, item) => {
|
|
655
|
+
const environment = item[this.environmentKey];
|
|
656
|
+
return Object.assign(Object.assign({}, items), { [environment.id]: environment });
|
|
657
|
+
}, {});
|
|
658
|
+
const groupedAclEntries = groupBy(aclEntries, (item) => {
|
|
659
|
+
var _a;
|
|
660
|
+
const environmentId = (_a = (item[this.environmentKey])) === null || _a === void 0 ? void 0 : _a.id;
|
|
661
|
+
return [item.aclRole.level, environmentId, item.objectId];
|
|
662
|
+
});
|
|
663
|
+
let aclObjectEntries = Object.keys(groupedAclEntries)
|
|
664
|
+
.reduce((accum, key) => {
|
|
665
|
+
const parts = key.split(',');
|
|
666
|
+
return [
|
|
667
|
+
...accum,
|
|
668
|
+
{
|
|
669
|
+
object: objects[parts[2]],
|
|
670
|
+
level: parts[0],
|
|
671
|
+
[`${this.environmentKey}Id`]: parts[1] ? parseInt(parts[1]) : null,
|
|
672
|
+
[this.environmentKey]: environments[parts[1]],
|
|
673
|
+
aclEntries: groupedAclEntries[key],
|
|
674
|
+
}
|
|
675
|
+
];
|
|
676
|
+
}, []);
|
|
677
|
+
const hasApp = aclObjectEntries.some((item) => {
|
|
678
|
+
return item.aclEntries.some((entry) => {
|
|
679
|
+
return !entry.objectId;
|
|
680
|
+
});
|
|
681
|
+
});
|
|
682
|
+
if (!hasApp) {
|
|
683
|
+
aclObjectEntries.unshift({
|
|
684
|
+
object: null,
|
|
685
|
+
aclEntries: [],
|
|
686
|
+
level: 'app',
|
|
687
|
+
environmentId: null,
|
|
688
|
+
});
|
|
689
|
+
}
|
|
690
|
+
aclObjectEntries = sortBy(aclObjectEntries, (item) => {
|
|
691
|
+
return item.object ? item.level : '';
|
|
692
|
+
});
|
|
693
|
+
observer.next({ data: aclObjectEntries });
|
|
694
|
+
observer.complete();
|
|
695
|
+
});
|
|
696
|
+
});
|
|
697
|
+
},
|
|
698
|
+
};
|
|
699
|
+
}
|
|
700
|
+
update(aclObjectEntry) {
|
|
701
|
+
const data = {
|
|
702
|
+
aclObjectEntry,
|
|
703
|
+
required: false,
|
|
704
|
+
loadAclRoles: this.loadAclRoles,
|
|
705
|
+
saveAclObjectEntry: this.saveAclObjectEntry
|
|
706
|
+
};
|
|
707
|
+
this._dialog.open(FsAclEntryComponent, {
|
|
708
|
+
data: data
|
|
709
|
+
})
|
|
710
|
+
.afterClosed()
|
|
711
|
+
.pipe(takeUntil(this._destroy$))
|
|
712
|
+
.subscribe(() => {
|
|
713
|
+
this.aclEntriesList.reload();
|
|
714
|
+
});
|
|
715
|
+
}
|
|
716
|
+
ngOnDestroy() {
|
|
717
|
+
this._destroy$.next();
|
|
718
|
+
this._destroy$.complete();
|
|
719
|
+
}
|
|
720
|
+
reload() {
|
|
721
|
+
this.aclEntriesList.reload();
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
FsAclEntriesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAclEntriesComponent, deps: [{ token: FsAppAclService }, { token: i2.MatDialog }, { token: i3$1.FsPrompt }], target: i0.ɵɵFactoryTarget.Component });
|
|
725
|
+
FsAclEntriesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsAclEntriesComponent, selector: "fs-acl-entries", inputs: { loadAclEntries: "loadAclEntries", loadAclRoles: "loadAclRoles", saveAclObjectEntry: "saveAclObjectEntry", environmentShow: "environmentShow", environmentLabel: "environmentLabel", environmentKey: "environmentKey", actions: "actions" }, viewQueries: [{ propertyName: "aclEntriesList", first: true, predicate: FsListComponent, descendants: true }], ngImport: i0, template: "\n<fs-list [config]=\"aclEntriesConfig\">\n <fs-list-column>\n <ng-template fs-list-header>Context</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <div\n *ngIf=\"row.object; else elseObject\"\n fxLayout=\"row\"\n fxLayoutAlign=\"start center\"\n fxLayoutGap=\"10px\">\n <fs-badge *ngIf=\"row.object.imageUrl\" shape=\"circle\" image=\"{{ row.object.imageUrl }}\"></fs-badge>\n <span>\n <div><small>{{ row.object.className }}</small></div>\n <a (click)=\"update(row)\">{{ row.object.name }}</a>\n </span>\n </div>\n\n <ng-template #elseObject>\n <a (click)=\"update(row)\">App</a>\n </ng-template>\n </ng-template>\n </fs-list-column>\n\n <fs-list-column [show]=\"environmentShow\">\n <ng-template fs-list-header>{{environmentLabel}}</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n {{row.environment?.name}}\n </ng-template>\n </fs-list-column>\n\n <fs-list-column>\n <ng-template fs-list-header>Roles</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <div fxLayout=\"column\" fxLayoutGap=\"10px\">\n <div div *ngFor=\"let aclEntry of row.aclEntries\">\n <ng-container [ngSwitch]=\"row.level\">\n <ng-container *ngSwitchCase=\"'app'\">\n <fs-acl-role-popover [aclRole]=\"aclEntry.aclRole\" objectName=\"App\">{{aclEntry.aclRole.name}}</fs-acl-role-popover>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container *ngIf=\"row.object\">\n <fs-acl-role-popover [aclRole]=\"aclEntry.aclRole\">{{aclEntry.aclRole.name}}</fs-acl-role-popover>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n </ng-template>\n </fs-list-column>\n</fs-list>\n", styles: [""], components: [{ type: i12.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i5$1.FsBadgeComponent, selector: "fs-badge", inputs: ["color", "text", "tooltip", "size", "shape", "image", "icon", "iconSize", "iconColor", "backgroundSize"] }, { type: FsAclRolePopoverComponent, selector: "fs-acl-role-popover", inputs: ["aclRole", "objectName"] }], directives: [{ type: i12.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i12.FsListHeaderDirective, selector: "[fs-list-header]", inputs: ["colspan", "align", "class"] }, { type: i12.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { type: i7$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i17.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i17.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { type: i17.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { type: i7$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i7$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i7$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }] });
|
|
726
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAclEntriesComponent, decorators: [{
|
|
727
|
+
type: Component,
|
|
728
|
+
args: [{
|
|
729
|
+
selector: 'fs-acl-entries',
|
|
730
|
+
templateUrl: './acl-entries.component.html',
|
|
731
|
+
styleUrls: ['./acl-entries.component.scss']
|
|
732
|
+
}]
|
|
733
|
+
}], ctorParameters: function () { return [{ type: FsAppAclService }, { type: i2.MatDialog }, { type: i3$1.FsPrompt }]; }, propDecorators: { loadAclEntries: [{
|
|
734
|
+
type: Input
|
|
735
|
+
}], loadAclRoles: [{
|
|
736
|
+
type: Input
|
|
737
|
+
}], saveAclObjectEntry: [{
|
|
738
|
+
type: Input
|
|
739
|
+
}], environmentShow: [{
|
|
740
|
+
type: Input
|
|
741
|
+
}], environmentLabel: [{
|
|
742
|
+
type: Input
|
|
743
|
+
}], environmentKey: [{
|
|
744
|
+
type: Input
|
|
745
|
+
}], actions: [{
|
|
746
|
+
type: Input
|
|
747
|
+
}], aclEntriesList: [{
|
|
748
|
+
type: ViewChild,
|
|
749
|
+
args: [FsListComponent]
|
|
747
750
|
}] } });
|
|
748
751
|
|
|
749
|
-
class FsAppAclModule {
|
|
750
|
-
}
|
|
751
|
-
FsAppAclModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAppAclModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
752
|
-
FsAppAclModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAppAclModule, declarations: [FsAclRolesComponent,
|
|
753
|
-
FsAclPermissionPopoverComponent,
|
|
754
|
-
FsAclRoleComponent,
|
|
755
|
-
FsAclEntriesComponent,
|
|
756
|
-
FsAclRolePopoverComponent,
|
|
757
|
-
FsAclObjectRolesComponent,
|
|
758
|
-
FsAclEntryComponent], imports: [CommonModule,
|
|
759
|
-
FormsModule,
|
|
760
|
-
MatDialogModule,
|
|
761
|
-
MatFormFieldModule,
|
|
762
|
-
MatCheckboxModule,
|
|
763
|
-
MatSelectModule,
|
|
764
|
-
MatButtonModule,
|
|
765
|
-
MatRadioModule,
|
|
766
|
-
MatInputModule,
|
|
767
|
-
FlexLayoutModule,
|
|
768
|
-
FsListModule,
|
|
769
|
-
FsPopoverModule,
|
|
770
|
-
FsDialogModule,
|
|
771
|
-
FsFormModule,
|
|
772
|
-
FsLabelModule,
|
|
773
|
-
FsRadioGroupModule,
|
|
774
|
-
FsBadgeModule,
|
|
775
|
-
FsCheckboxGroupModule], exports: [FsAclRolesComponent,
|
|
776
|
-
FsAclPermissionPopoverComponent,
|
|
777
|
-
FsAclRoleComponent,
|
|
778
|
-
FsAclEntriesComponent,
|
|
779
|
-
FsAclRolePopoverComponent,
|
|
780
|
-
FsAclObjectRolesComponent,
|
|
781
|
-
FsAclEntryComponent] });
|
|
782
|
-
FsAppAclModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAppAclModule, imports: [[
|
|
783
|
-
CommonModule,
|
|
784
|
-
FormsModule,
|
|
785
|
-
MatDialogModule,
|
|
786
|
-
MatFormFieldModule,
|
|
787
|
-
MatCheckboxModule,
|
|
788
|
-
MatSelectModule,
|
|
789
|
-
MatButtonModule,
|
|
790
|
-
MatRadioModule,
|
|
791
|
-
MatInputModule,
|
|
792
|
-
FlexLayoutModule,
|
|
793
|
-
FsListModule,
|
|
794
|
-
FsPopoverModule,
|
|
795
|
-
FsDialogModule,
|
|
796
|
-
FsFormModule,
|
|
797
|
-
FsLabelModule,
|
|
798
|
-
FsRadioGroupModule,
|
|
799
|
-
FsBadgeModule,
|
|
800
|
-
FsCheckboxGroupModule,
|
|
801
|
-
]] });
|
|
802
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAppAclModule, decorators: [{
|
|
803
|
-
type: NgModule,
|
|
804
|
-
args: [{
|
|
805
|
-
imports: [
|
|
806
|
-
CommonModule,
|
|
807
|
-
FormsModule,
|
|
808
|
-
MatDialogModule,
|
|
809
|
-
MatFormFieldModule,
|
|
810
|
-
MatCheckboxModule,
|
|
811
|
-
MatSelectModule,
|
|
812
|
-
MatButtonModule,
|
|
813
|
-
MatRadioModule,
|
|
814
|
-
MatInputModule,
|
|
815
|
-
FlexLayoutModule,
|
|
816
|
-
FsListModule,
|
|
817
|
-
FsPopoverModule,
|
|
818
|
-
FsDialogModule,
|
|
819
|
-
FsFormModule,
|
|
820
|
-
FsLabelModule,
|
|
821
|
-
FsRadioGroupModule,
|
|
822
|
-
FsBadgeModule,
|
|
823
|
-
FsCheckboxGroupModule,
|
|
824
|
-
],
|
|
825
|
-
declarations: [
|
|
826
|
-
FsAclRolesComponent,
|
|
827
|
-
FsAclPermissionPopoverComponent,
|
|
828
|
-
FsAclRoleComponent,
|
|
829
|
-
FsAclEntriesComponent,
|
|
830
|
-
FsAclRolePopoverComponent,
|
|
831
|
-
FsAclObjectRolesComponent,
|
|
832
|
-
FsAclEntryComponent,
|
|
833
|
-
],
|
|
834
|
-
exports: [
|
|
835
|
-
FsAclRolesComponent,
|
|
836
|
-
FsAclPermissionPopoverComponent,
|
|
837
|
-
FsAclRoleComponent,
|
|
838
|
-
FsAclEntriesComponent,
|
|
839
|
-
FsAclRolePopoverComponent,
|
|
840
|
-
FsAclObjectRolesComponent,
|
|
841
|
-
FsAclEntryComponent,
|
|
842
|
-
],
|
|
843
|
-
}]
|
|
752
|
+
class FsAppAclModule {
|
|
753
|
+
}
|
|
754
|
+
FsAppAclModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAppAclModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
755
|
+
FsAppAclModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAppAclModule, declarations: [FsAclRolesComponent,
|
|
756
|
+
FsAclPermissionPopoverComponent,
|
|
757
|
+
FsAclRoleComponent,
|
|
758
|
+
FsAclEntriesComponent,
|
|
759
|
+
FsAclRolePopoverComponent,
|
|
760
|
+
FsAclObjectRolesComponent,
|
|
761
|
+
FsAclEntryComponent], imports: [CommonModule,
|
|
762
|
+
FormsModule,
|
|
763
|
+
MatDialogModule,
|
|
764
|
+
MatFormFieldModule,
|
|
765
|
+
MatCheckboxModule,
|
|
766
|
+
MatSelectModule,
|
|
767
|
+
MatButtonModule,
|
|
768
|
+
MatRadioModule,
|
|
769
|
+
MatInputModule,
|
|
770
|
+
FlexLayoutModule,
|
|
771
|
+
FsListModule,
|
|
772
|
+
FsPopoverModule,
|
|
773
|
+
FsDialogModule,
|
|
774
|
+
FsFormModule,
|
|
775
|
+
FsLabelModule,
|
|
776
|
+
FsRadioGroupModule,
|
|
777
|
+
FsBadgeModule,
|
|
778
|
+
FsCheckboxGroupModule], exports: [FsAclRolesComponent,
|
|
779
|
+
FsAclPermissionPopoverComponent,
|
|
780
|
+
FsAclRoleComponent,
|
|
781
|
+
FsAclEntriesComponent,
|
|
782
|
+
FsAclRolePopoverComponent,
|
|
783
|
+
FsAclObjectRolesComponent,
|
|
784
|
+
FsAclEntryComponent] });
|
|
785
|
+
FsAppAclModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAppAclModule, imports: [[
|
|
786
|
+
CommonModule,
|
|
787
|
+
FormsModule,
|
|
788
|
+
MatDialogModule,
|
|
789
|
+
MatFormFieldModule,
|
|
790
|
+
MatCheckboxModule,
|
|
791
|
+
MatSelectModule,
|
|
792
|
+
MatButtonModule,
|
|
793
|
+
MatRadioModule,
|
|
794
|
+
MatInputModule,
|
|
795
|
+
FlexLayoutModule,
|
|
796
|
+
FsListModule,
|
|
797
|
+
FsPopoverModule,
|
|
798
|
+
FsDialogModule,
|
|
799
|
+
FsFormModule,
|
|
800
|
+
FsLabelModule,
|
|
801
|
+
FsRadioGroupModule,
|
|
802
|
+
FsBadgeModule,
|
|
803
|
+
FsCheckboxGroupModule,
|
|
804
|
+
]] });
|
|
805
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAppAclModule, decorators: [{
|
|
806
|
+
type: NgModule,
|
|
807
|
+
args: [{
|
|
808
|
+
imports: [
|
|
809
|
+
CommonModule,
|
|
810
|
+
FormsModule,
|
|
811
|
+
MatDialogModule,
|
|
812
|
+
MatFormFieldModule,
|
|
813
|
+
MatCheckboxModule,
|
|
814
|
+
MatSelectModule,
|
|
815
|
+
MatButtonModule,
|
|
816
|
+
MatRadioModule,
|
|
817
|
+
MatInputModule,
|
|
818
|
+
FlexLayoutModule,
|
|
819
|
+
FsListModule,
|
|
820
|
+
FsPopoverModule,
|
|
821
|
+
FsDialogModule,
|
|
822
|
+
FsFormModule,
|
|
823
|
+
FsLabelModule,
|
|
824
|
+
FsRadioGroupModule,
|
|
825
|
+
FsBadgeModule,
|
|
826
|
+
FsCheckboxGroupModule,
|
|
827
|
+
],
|
|
828
|
+
declarations: [
|
|
829
|
+
FsAclRolesComponent,
|
|
830
|
+
FsAclPermissionPopoverComponent,
|
|
831
|
+
FsAclRoleComponent,
|
|
832
|
+
FsAclEntriesComponent,
|
|
833
|
+
FsAclRolePopoverComponent,
|
|
834
|
+
FsAclObjectRolesComponent,
|
|
835
|
+
FsAclEntryComponent,
|
|
836
|
+
],
|
|
837
|
+
exports: [
|
|
838
|
+
FsAclRolesComponent,
|
|
839
|
+
FsAclPermissionPopoverComponent,
|
|
840
|
+
FsAclRoleComponent,
|
|
841
|
+
FsAclEntriesComponent,
|
|
842
|
+
FsAclRolePopoverComponent,
|
|
843
|
+
FsAclObjectRolesComponent,
|
|
844
|
+
FsAclEntryComponent,
|
|
845
|
+
],
|
|
846
|
+
}]
|
|
844
847
|
}] });
|
|
845
848
|
|
|
846
|
-
/**
|
|
847
|
-
* Generated bundle index. Do not edit.
|
|
849
|
+
/**
|
|
850
|
+
* Generated bundle index. Do not edit.
|
|
848
851
|
*/
|
|
849
852
|
|
|
850
853
|
export { FS_APP_ACL_CONFIG, FsAclEntriesComponent, FsAclEntryComponent, FsAclObjectRolesComponent, FsAclPermissionPopoverComponent, FsAclRoleComponent, FsAclRolePopoverComponent, FsAclRolesComponent, FsAppAclModule, FsAppAclService };
|