34
34
<Url :url =" '/adabas/database' + url + '/file'" />
35
35
</b-col >
36
36
</b-row >
37
+ <b-row >
38
+ <b-col sm =" 2" >
39
+ <b-button v-b-modal.modal-create variant =" outline-primary"
40
+ >Create resource</b-button
41
+ > </b-col
42
+ ><b-col sm =" 2" >
43
+ <b-button v-b-modal.modal-grant variant =" outline-primary"
44
+ >Grant resource</b-button
45
+ > </b-col
46
+ ><b-col sm =" 2" >
47
+ <b-button v-b-modal.modal-assign variant =" outline-primary"
48
+ >Assign role</b-button
49
+ >
50
+ </b-col >
51
+ <b-col sm =" 6" class =" text-right" >
52
+ <b-button variant =" outline-primary" >Refresh</b-button >
53
+ </b-col >
54
+ </b-row >
37
55
<b-row
38
56
><b-col sm =" 10" >
39
57
<b-tabs content-class =" mt-3" >
118
136
class =" mt-3"
119
137
></b-form-select > </b-col ></b-row
120
138
><b-row >
121
- <b-col sm =" 2" >
122
- <b-button
123
- v-b-modal.modal-create
124
- variant =" outline-primary"
125
- >Create resource</b-button
126
- > </b-col
127
- ><b-col sm =" 2" >
128
- <b-button
129
- v-b-modal.modal-grant
130
- variant =" outline-primary"
131
- >Grant resource</b-button
132
- >
133
- </b-col >
134
- <b-col sm =" 8" >
139
+ <b-col sm =" 12" >
135
140
<b-form-group
136
141
label =" Filter"
137
142
label-cols-sm =" 3"
213
218
id =" modal-grant"
214
219
size =" lg"
215
220
title =" Create Adabas Role-Base resource"
216
- @ok =" createResource "
221
+ @ok =" grantResource "
217
222
no-stacking
218
223
>
219
224
<p >Create Adabas Role-based Access resource</p >
220
225
<b-container >
221
226
<b-row >
222
227
<b-col sm =" 2" >Object:</b-col >
223
- <b-col sm =" 9 " >
228
+ <b-col sm =" 4 " >
224
229
<b-form-select
225
230
v-model =" newObject"
226
231
:options =" objects"
227
232
></b-form-select > </b-col
233
+ ><b-col sm =" 5" >
234
+ <b-form-input
235
+ type =" number"
236
+ v-model =" fnr"
237
+ placeholder =" Adabas File"
238
+ ></b-form-input ></b-col
228
239
></b-row >
229
240
<b-row >
230
241
<b-col sm =" 2" >Operation:</b-col >
231
242
<b-col sm =" 9" >
232
243
<b-form-select
233
244
v-model =" newOperation"
234
245
:options =" operations"
246
+ ></b-form-select >
247
+ </b-col >
248
+ </b-row >
249
+ <b-row >
250
+ <b-col sm =" 2" >Assign to Role:</b-col >
251
+ <b-col sm =" 9" >
252
+ <b-form-select
253
+ v-model =" newRole"
254
+ :options =" roles"
255
+ ></b-form-select > </b-col
256
+ ></b-row >
257
+ </b-container >
258
+ <template #modal-footer =" { ok , cancel , hide } " >
259
+ <b >Custom Footer</b >
260
+ <!-- Emulate built in modal footer ok and cancel button actions -->
261
+ <b-button size =" sm" variant =" success" @click =" ok()" > Grant </b-button >
262
+ <b-button size =" sm" variant =" danger" @click =" cancel()" >
263
+ Revoke
264
+ </b-button >
265
+ <!-- Button with custom close trigger value -->
266
+ <b-button size =" sm" variant =" outline-secondary" @click =" hide('forget')" >
267
+ Forget it
268
+ </b-button >
269
+ </template >
270
+ </b-modal >
271
+ <b-modal
272
+ id =" modal-assign"
273
+ size =" lg"
274
+ title =" Assignn Adabas Role-Base resource to user"
275
+ @ok =" assignUser"
276
+ no-stacking
277
+ >
278
+ <p >Assign Adabas Role-based Access resource</p >
279
+ <b-container >
280
+ <b-row >
281
+ <b-col sm =" 2" >Assign to User:</b-col >
282
+ <b-col sm =" 9" >
283
+ <b-form-select
284
+ v-model =" newName"
285
+ :options =" users"
235
286
></b-form-select > </b-col
236
287
></b-row >
237
288
<b-row >
243
294
></b-form-select > </b-col
244
295
></b-row >
245
296
</b-container >
297
+ <template #modal-footer =" { ok , cancel , hide } " >
298
+ <b >Custom Footer</b >
299
+ <!-- Emulate built in modal footer ok and cancel button actions -->
300
+ <b-button size =" sm" variant =" success" @click =" ok()" > Grant </b-button >
301
+ <b-button size =" sm" variant =" danger" @click =" cancel()" >
302
+ Revoke
303
+ </b-button >
304
+ <!-- Button with custom close trigger value -->
305
+ <b-button size =" sm" variant =" outline-secondary" @click =" hide('forget')" >
306
+ Forget it
307
+ </b-button >
308
+ </template >
246
309
</b-modal >
247
310
<StatusBar />
248
311
</div >
@@ -278,6 +341,7 @@ export default class PermissionList extends Vue {
278
341
operations: [],
279
342
objects: [],
280
343
roles: [],
344
+ users: [],
281
345
fields: [' Operation' , ' Object' , ' Role' ],
282
346
userRoleFields: [' User' , ' Role' ],
283
347
options: [' User' , ' Role' , ' Object' , ' Operation' ],
@@ -290,6 +354,7 @@ export default class PermissionList extends Vue {
290
354
newRole: ' ' ,
291
355
newObject: ' ' ,
292
356
newOperation: ' ' ,
357
+ fnr: undefined as number | undefined ,
293
358
};
294
359
}
295
360
created(): void {
@@ -318,7 +383,7 @@ export default class PermissionList extends Vue {
318
383
}
319
384
if (this .$data .operations .length == 0 ) {
320
385
this .$data .db .resourceList (' operation' ).then ((response : any ) => {
321
- this .$data .operations = [];
386
+ this .$data .operations = [' any ' ];
322
387
response .forEach ((element : any ) => {
323
388
this .$data .operations .push (element .Operation );
324
389
});
@@ -332,6 +397,15 @@ export default class PermissionList extends Vue {
332
397
});
333
398
});
334
399
}
400
+ if (this .$data .users .length == 0 ) {
401
+ this .$data .db .resourceList (' user' ).then ((response : any ) => {
402
+ this .$data .users = [];
403
+ response .forEach ((element : any ) => {
404
+ console .log (" USER: " + JSON .stringify (element )+ ' ->' + element .User );
405
+ this .$data .users .push (element .User );
406
+ });
407
+ });
408
+ }
335
409
336
410
await this .$data .db .permissionList ().then ((response : any ) => {
337
411
this .$data .permission = response ;
@@ -366,6 +440,12 @@ export default class PermissionList extends Vue {
366
440
},
367
441
],
368
442
};
443
+ if (this .$data .fnr ) {
444
+ var s = ' 000000000' + this .$data .fnr ;
445
+ s = s .substr (s .length - 8 );
446
+
447
+ def .Definition [0 ].Object = ' FILE.' + s ;
448
+ }
369
449
this .$data .db .grantRBAC (def );
370
450
}
371
451
reloadResource() {
0 commit comments