-
Notifications
You must be signed in to change notification settings - Fork 327
/
access_control.gen.go
1849 lines (1657 loc) · 50.4 KB
/
access_control.gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
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
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package service
// This file is auto-generated.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
import (
"context"
"fmt"
"github.com/cortezaproject/corteza/server/pkg/actionlog"
internalAuth "github.com/cortezaproject/corteza/server/pkg/auth"
"github.com/cortezaproject/corteza/server/pkg/rbac"
"github.com/cortezaproject/corteza/server/store"
"github.com/cortezaproject/corteza/server/system/types"
systemTypes "github.com/cortezaproject/corteza/server/system/types"
"github.com/spf13/cast"
"strings"
)
type (
rbacService interface {
Can(rbac.Session, string, rbac.Resource) bool
Trace(rbac.Session, string, rbac.Resource) *rbac.Trace
Grant(context.Context, ...*rbac.Rule) error
FindRulesByRoleID(roleID uint64) (rr rbac.RuleSet)
}
accessControl struct {
actionlog actionlog.Recorder
store store.Storer
rbac rbacService
}
)
func AccessControl(s store.Storer) *accessControl {
return &accessControl{
store: s,
rbac: rbac.Global(),
actionlog: DefaultActionlog,
}
}
func (svc accessControl) can(ctx context.Context, op string, res rbac.Resource) bool {
return svc.rbac.Can(rbac.ContextToSession(ctx), op, res)
}
// Effective returns a list of effective permissions for all given resource
//
// This function is auto-generated
func (svc accessControl) Effective(ctx context.Context, rr ...rbac.Resource) (ee rbac.EffectiveSet) {
for _, res := range rr {
r := res.RbacResource()
for op := range rbacResourceOperations(r) {
ee.Push(r, op, svc.can(ctx, op, res))
}
}
return
}
// Evaluate returns a list of permissions evaluated for the given user/roles combo
//
// This function is auto-generated
func (svc accessControl) Trace(ctx context.Context, userID uint64, roles []uint64, rr ...string) (ee []*rbac.Trace, err error) {
// Reusing the grant permission since this is who the feature is for
if !svc.CanGrant(ctx) {
// @todo should be altered to check grant permissions PER resource
return nil, AccessControlErrNotAllowedToSetPermissions()
}
var (
resource rbac.Resource
resources []rbac.Resource
members systemTypes.RoleMemberSet
)
if len(rr) > 0 {
resources = make([]rbac.Resource, 0, len(rr))
for _, r := range rr {
if err = rbacResourceValidator(r); err != nil {
return nil, fmt.Errorf("can not use resource %q: %w", r, err)
}
resource, err = svc.resourceLoader(ctx, r)
if err != nil {
return
}
resources = append(resources, resource)
}
} else {
resources = svc.Resources()
}
// User ID specified, load its roles
if userID != 0 {
if len(roles) > 0 {
// should be prevented on the client
return nil, fmt.Errorf("userID and roles are mutually exclusive")
}
members, _, err = store.SearchRoleMembers(ctx, svc.store, systemTypes.RoleMemberFilter{UserID: userID})
if err != nil {
return nil, err
}
for _, m := range members {
roles = append(roles, m.RoleID)
}
for _, r := range internalAuth.AuthenticatedRoles() {
roles = append(roles, r.ID)
}
}
if len(roles) == 0 {
// should be prevented on the client
return nil, fmt.Errorf("no roles specified")
}
session := rbac.ParamsToSession(ctx, userID, roles...)
for _, res := range resources {
r := res.RbacResource()
for op := range rbacResourceOperations(r) {
ee = append(ee, svc.rbac.Trace(session, op, res))
}
}
return
}
// Resources returns list of resources
//
// This function is auto-generated
func (svc accessControl) Resources() []rbac.Resource {
return []rbac.Resource{
rbac.NewResource(types.ApplicationRbacResource(0)),
rbac.NewResource(types.ApigwRouteRbacResource(0)),
rbac.NewResource(types.AuthClientRbacResource(0)),
rbac.NewResource(types.DataPrivacyRequestRbacResource(0)),
rbac.NewResource(types.QueueRbacResource(0)),
rbac.NewResource(types.ReportRbacResource(0)),
rbac.NewResource(types.RoleRbacResource(0)),
rbac.NewResource(types.TemplateRbacResource(0)),
rbac.NewResource(types.UserRbacResource(0)),
rbac.NewResource(types.DalConnectionRbacResource(0)),
rbac.NewResource(types.ComponentRbacResource()),
}
}
// List returns list of operations on all resources
//
// This function is auto-generated
func (svc accessControl) List() (out []map[string]string) {
def := []map[string]string{
{
"type": types.ApplicationResourceType,
"any": types.ApplicationRbacResource(0),
"op": "read",
},
{
"type": types.ApplicationResourceType,
"any": types.ApplicationRbacResource(0),
"op": "update",
},
{
"type": types.ApplicationResourceType,
"any": types.ApplicationRbacResource(0),
"op": "delete",
},
{
"type": types.ApigwRouteResourceType,
"any": types.ApigwRouteRbacResource(0),
"op": "read",
},
{
"type": types.ApigwRouteResourceType,
"any": types.ApigwRouteRbacResource(0),
"op": "update",
},
{
"type": types.ApigwRouteResourceType,
"any": types.ApigwRouteRbacResource(0),
"op": "delete",
},
{
"type": types.AuthClientResourceType,
"any": types.AuthClientRbacResource(0),
"op": "read",
},
{
"type": types.AuthClientResourceType,
"any": types.AuthClientRbacResource(0),
"op": "update",
},
{
"type": types.AuthClientResourceType,
"any": types.AuthClientRbacResource(0),
"op": "delete",
},
{
"type": types.AuthClientResourceType,
"any": types.AuthClientRbacResource(0),
"op": "authorize",
},
{
"type": types.DataPrivacyRequestResourceType,
"any": types.DataPrivacyRequestRbacResource(0),
"op": "read",
},
{
"type": types.DataPrivacyRequestResourceType,
"any": types.DataPrivacyRequestRbacResource(0),
"op": "approve",
},
{
"type": types.QueueResourceType,
"any": types.QueueRbacResource(0),
"op": "read",
},
{
"type": types.QueueResourceType,
"any": types.QueueRbacResource(0),
"op": "update",
},
{
"type": types.QueueResourceType,
"any": types.QueueRbacResource(0),
"op": "delete",
},
{
"type": types.QueueResourceType,
"any": types.QueueRbacResource(0),
"op": "queue.read",
},
{
"type": types.QueueResourceType,
"any": types.QueueRbacResource(0),
"op": "queue.write",
},
{
"type": types.ReportResourceType,
"any": types.ReportRbacResource(0),
"op": "read",
},
{
"type": types.ReportResourceType,
"any": types.ReportRbacResource(0),
"op": "update",
},
{
"type": types.ReportResourceType,
"any": types.ReportRbacResource(0),
"op": "delete",
},
{
"type": types.ReportResourceType,
"any": types.ReportRbacResource(0),
"op": "run",
},
{
"type": types.RoleResourceType,
"any": types.RoleRbacResource(0),
"op": "read",
},
{
"type": types.RoleResourceType,
"any": types.RoleRbacResource(0),
"op": "update",
},
{
"type": types.RoleResourceType,
"any": types.RoleRbacResource(0),
"op": "delete",
},
{
"type": types.RoleResourceType,
"any": types.RoleRbacResource(0),
"op": "members.manage",
},
{
"type": types.TemplateResourceType,
"any": types.TemplateRbacResource(0),
"op": "read",
},
{
"type": types.TemplateResourceType,
"any": types.TemplateRbacResource(0),
"op": "update",
},
{
"type": types.TemplateResourceType,
"any": types.TemplateRbacResource(0),
"op": "delete",
},
{
"type": types.TemplateResourceType,
"any": types.TemplateRbacResource(0),
"op": "render",
},
{
"type": types.UserResourceType,
"any": types.UserRbacResource(0),
"op": "read",
},
{
"type": types.UserResourceType,
"any": types.UserRbacResource(0),
"op": "update",
},
{
"type": types.UserResourceType,
"any": types.UserRbacResource(0),
"op": "delete",
},
{
"type": types.UserResourceType,
"any": types.UserRbacResource(0),
"op": "suspend",
},
{
"type": types.UserResourceType,
"any": types.UserRbacResource(0),
"op": "unsuspend",
},
{
"type": types.UserResourceType,
"any": types.UserRbacResource(0),
"op": "email.unmask",
},
{
"type": types.UserResourceType,
"any": types.UserRbacResource(0),
"op": "name.unmask",
},
{
"type": types.UserResourceType,
"any": types.UserRbacResource(0),
"op": "impersonate",
},
{
"type": types.UserResourceType,
"any": types.UserRbacResource(0),
"op": "credentials.manage",
},
{
"type": types.DalConnectionResourceType,
"any": types.DalConnectionRbacResource(0),
"op": "read",
},
{
"type": types.DalConnectionResourceType,
"any": types.DalConnectionRbacResource(0),
"op": "update",
},
{
"type": types.DalConnectionResourceType,
"any": types.DalConnectionRbacResource(0),
"op": "delete",
},
{
"type": types.DalConnectionResourceType,
"any": types.DalConnectionRbacResource(0),
"op": "dal-config.manage",
},
{
"type": types.ComponentResourceType,
"any": types.ComponentRbacResource(),
"op": "grant",
},
{
"type": types.ComponentResourceType,
"any": types.ComponentRbacResource(),
"op": "action-log.read",
},
{
"type": types.ComponentResourceType,
"any": types.ComponentRbacResource(),
"op": "settings.read",
},
{
"type": types.ComponentResourceType,
"any": types.ComponentRbacResource(),
"op": "settings.manage",
},
{
"type": types.ComponentResourceType,
"any": types.ComponentRbacResource(),
"op": "auth-client.create",
},
{
"type": types.ComponentResourceType,
"any": types.ComponentRbacResource(),
"op": "auth-clients.search",
},
{
"type": types.ComponentResourceType,
"any": types.ComponentRbacResource(),
"op": "role.create",
},
{
"type": types.ComponentResourceType,
"any": types.ComponentRbacResource(),
"op": "roles.search",
},
{
"type": types.ComponentResourceType,
"any": types.ComponentRbacResource(),
"op": "user.create",
},
{
"type": types.ComponentResourceType,
"any": types.ComponentRbacResource(),
"op": "users.search",
},
{
"type": types.ComponentResourceType,
"any": types.ComponentRbacResource(),
"op": "dal-connection.create",
},
{
"type": types.ComponentResourceType,
"any": types.ComponentRbacResource(),
"op": "dal-connections.search",
},
{
"type": types.ComponentResourceType,
"any": types.ComponentRbacResource(),
"op": "dal-sensitivity-level.manage",
},
{
"type": types.ComponentResourceType,
"any": types.ComponentRbacResource(),
"op": "application.create",
},
{
"type": types.ComponentResourceType,
"any": types.ComponentRbacResource(),
"op": "applications.search",
},
{
"type": types.ComponentResourceType,
"any": types.ComponentRbacResource(),
"op": "application.flag.self",
},
{
"type": types.ComponentResourceType,
"any": types.ComponentRbacResource(),
"op": "application.flag.global",
},
{
"type": types.ComponentResourceType,
"any": types.ComponentRbacResource(),
"op": "template.create",
},
{
"type": types.ComponentResourceType,
"any": types.ComponentRbacResource(),
"op": "templates.search",
},
{
"type": types.ComponentResourceType,
"any": types.ComponentRbacResource(),
"op": "report.create",
},
{
"type": types.ComponentResourceType,
"any": types.ComponentRbacResource(),
"op": "reports.search",
},
{
"type": types.ComponentResourceType,
"any": types.ComponentRbacResource(),
"op": "reminder.assign",
},
{
"type": types.ComponentResourceType,
"any": types.ComponentRbacResource(),
"op": "queue.create",
},
{
"type": types.ComponentResourceType,
"any": types.ComponentRbacResource(),
"op": "queues.search",
},
{
"type": types.ComponentResourceType,
"any": types.ComponentRbacResource(),
"op": "apigw-route.create",
},
{
"type": types.ComponentResourceType,
"any": types.ComponentRbacResource(),
"op": "apigw-routes.search",
},
{
"type": types.ComponentResourceType,
"any": types.ComponentRbacResource(),
"op": "resource-translations.manage",
},
{
"type": types.ComponentResourceType,
"any": types.ComponentRbacResource(),
"op": "dal-schema-alterations.manage",
},
{
"type": types.ComponentResourceType,
"any": types.ComponentRbacResource(),
"op": "data-privacy-request.create",
},
{
"type": types.ComponentResourceType,
"any": types.ComponentRbacResource(),
"op": "data-privacy-requests.search",
},
}
func(svc interface{}) {
if svc, is := svc.(interface{}).(interface{ list() []map[string]string }); is {
def = append(def, svc.list()...)
}
}(svc)
return def
}
// Grant applies one or more RBAC rules
//
// This function is auto-generated
func (svc accessControl) Grant(ctx context.Context, rr ...*rbac.Rule) error {
if !svc.CanGrant(ctx) {
// @todo should be altered to check grant permissions PER resource
return AccessControlErrNotAllowedToSetPermissions()
}
for _, r := range rr {
err := rbacResourceValidator(r.Resource, r.Operation)
if err != nil {
return err
}
}
if err := svc.rbac.Grant(ctx, rr...); err != nil {
return AccessControlErrGeneric().Wrap(err)
}
svc.logGrants(ctx, rr)
return nil
}
// This function is auto-generated
func (svc accessControl) logGrants(ctx context.Context, rr []*rbac.Rule) {
if svc.actionlog == nil {
return
}
for _, r := range rr {
g := AccessControlActionGrant(&accessControlActionProps{r})
g.log = r.String()
g.resource = r.Resource
svc.actionlog.Record(ctx, g.ToAction())
}
}
// FindRules find all rules based on filters
//
// This function is auto-generated
func (svc accessControl) FindRules(ctx context.Context, roleID uint64, rr ...string) (out rbac.RuleSet, err error) {
if !svc.CanGrant(ctx) {
return nil, AccessControlErrNotAllowedToSetPermissions()
}
out, err = svc.FindRulesByRoleID(ctx, roleID)
if err != nil {
return
}
var resources []rbac.Resource
if len(rr) > 0 {
resources = make([]rbac.Resource, 0, len(rr))
for _, r := range rr {
if err = rbacResourceValidator(r); err != nil {
return nil, fmt.Errorf("can not use resource %q: %w", r, err)
}
resources = append(resources, rbac.NewResource(r))
}
} else {
resources = svc.Resources()
}
return out.FilterResource(resources...), nil
}
// FindRulesByRoleID find all rules for a specific role
//
// This function is auto-generated
func (svc accessControl) FindRulesByRoleID(ctx context.Context, roleID uint64) (rbac.RuleSet, error) {
if !svc.CanGrant(ctx) {
return nil, AccessControlErrNotAllowedToSetPermissions()
}
return svc.rbac.FindRulesByRoleID(roleID), nil
}
// CanReadApplication checks if current user can read application
//
// This function is auto-generated
func (svc accessControl) CanReadApplication(ctx context.Context, r *types.Application) bool {
return svc.can(ctx, "read", r)
}
// CanUpdateApplication checks if current user can update application
//
// This function is auto-generated
func (svc accessControl) CanUpdateApplication(ctx context.Context, r *types.Application) bool {
return svc.can(ctx, "update", r)
}
// CanDeleteApplication checks if current user can delete application
//
// This function is auto-generated
func (svc accessControl) CanDeleteApplication(ctx context.Context, r *types.Application) bool {
return svc.can(ctx, "delete", r)
}
// CanReadApigwRoute checks if current user can read api gateway route
//
// This function is auto-generated
func (svc accessControl) CanReadApigwRoute(ctx context.Context, r *types.ApigwRoute) bool {
return svc.can(ctx, "read", r)
}
// CanUpdateApigwRoute checks if current user can update api gateway route
//
// This function is auto-generated
func (svc accessControl) CanUpdateApigwRoute(ctx context.Context, r *types.ApigwRoute) bool {
return svc.can(ctx, "update", r)
}
// CanDeleteApigwRoute checks if current user can delete api gateway route
//
// This function is auto-generated
func (svc accessControl) CanDeleteApigwRoute(ctx context.Context, r *types.ApigwRoute) bool {
return svc.can(ctx, "delete", r)
}
// CanReadAuthClient checks if current user can read authorization client
//
// This function is auto-generated
func (svc accessControl) CanReadAuthClient(ctx context.Context, r *types.AuthClient) bool {
return svc.can(ctx, "read", r)
}
// CanUpdateAuthClient checks if current user can update authorization client
//
// This function is auto-generated
func (svc accessControl) CanUpdateAuthClient(ctx context.Context, r *types.AuthClient) bool {
return svc.can(ctx, "update", r)
}
// CanDeleteAuthClient checks if current user can delete authorization client
//
// This function is auto-generated
func (svc accessControl) CanDeleteAuthClient(ctx context.Context, r *types.AuthClient) bool {
return svc.can(ctx, "delete", r)
}
// CanAuthorizeAuthClient checks if current user can authorize authorization client
//
// This function is auto-generated
func (svc accessControl) CanAuthorizeAuthClient(ctx context.Context, r *types.AuthClient) bool {
return svc.can(ctx, "authorize", r)
}
// CanReadDataPrivacyRequest checks if current user can read data privacy request
//
// This function is auto-generated
func (svc accessControl) CanReadDataPrivacyRequest(ctx context.Context, r *types.DataPrivacyRequest) bool {
return svc.can(ctx, "read", r)
}
// CanApproveDataPrivacyRequest checks if current user can approve/reject data privacy request
//
// This function is auto-generated
func (svc accessControl) CanApproveDataPrivacyRequest(ctx context.Context, r *types.DataPrivacyRequest) bool {
return svc.can(ctx, "approve", r)
}
// CanReadQueue checks if current user can read queue
//
// This function is auto-generated
func (svc accessControl) CanReadQueue(ctx context.Context, r *types.Queue) bool {
return svc.can(ctx, "read", r)
}
// CanUpdateQueue checks if current user can update queue
//
// This function is auto-generated
func (svc accessControl) CanUpdateQueue(ctx context.Context, r *types.Queue) bool {
return svc.can(ctx, "update", r)
}
// CanDeleteQueue checks if current user can delete queue
//
// This function is auto-generated
func (svc accessControl) CanDeleteQueue(ctx context.Context, r *types.Queue) bool {
return svc.can(ctx, "delete", r)
}
// CanReadQueueOnQueue checks if current user can read from queue
//
// This function is auto-generated
func (svc accessControl) CanReadQueueOnQueue(ctx context.Context, r *types.Queue) bool {
return svc.can(ctx, "queue.read", r)
}
// CanWriteQueueOnQueue checks if current user can write to queue
//
// This function is auto-generated
func (svc accessControl) CanWriteQueueOnQueue(ctx context.Context, r *types.Queue) bool {
return svc.can(ctx, "queue.write", r)
}
// CanReadReport checks if current user can read report
//
// This function is auto-generated
func (svc accessControl) CanReadReport(ctx context.Context, r *types.Report) bool {
return svc.can(ctx, "read", r)
}
// CanUpdateReport checks if current user can update report
//
// This function is auto-generated
func (svc accessControl) CanUpdateReport(ctx context.Context, r *types.Report) bool {
return svc.can(ctx, "update", r)
}
// CanDeleteReport checks if current user can delete report
//
// This function is auto-generated
func (svc accessControl) CanDeleteReport(ctx context.Context, r *types.Report) bool {
return svc.can(ctx, "delete", r)
}
// CanRunReport checks if current user can run report
//
// This function is auto-generated
func (svc accessControl) CanRunReport(ctx context.Context, r *types.Report) bool {
return svc.can(ctx, "run", r)
}
// CanReadRole checks if current user can read role
//
// This function is auto-generated
func (svc accessControl) CanReadRole(ctx context.Context, r *types.Role) bool {
return svc.can(ctx, "read", r)
}
// CanUpdateRole checks if current user can update role
//
// This function is auto-generated
func (svc accessControl) CanUpdateRole(ctx context.Context, r *types.Role) bool {
return svc.can(ctx, "update", r)
}
// CanDeleteRole checks if current user can delete role
//
// This function is auto-generated
func (svc accessControl) CanDeleteRole(ctx context.Context, r *types.Role) bool {
return svc.can(ctx, "delete", r)
}
// CanManageMembersOnRole checks if current user can manage members
//
// This function is auto-generated
func (svc accessControl) CanManageMembersOnRole(ctx context.Context, r *types.Role) bool {
return svc.can(ctx, "members.manage", r)
}
// CanReadTemplate checks if current user can read template
//
// This function is auto-generated
func (svc accessControl) CanReadTemplate(ctx context.Context, r *types.Template) bool {
return svc.can(ctx, "read", r)
}
// CanUpdateTemplate checks if current user can update template
//
// This function is auto-generated
func (svc accessControl) CanUpdateTemplate(ctx context.Context, r *types.Template) bool {
return svc.can(ctx, "update", r)
}
// CanDeleteTemplate checks if current user can delete template
//
// This function is auto-generated
func (svc accessControl) CanDeleteTemplate(ctx context.Context, r *types.Template) bool {
return svc.can(ctx, "delete", r)
}
// CanRenderTemplate checks if current user can render template
//
// This function is auto-generated
func (svc accessControl) CanRenderTemplate(ctx context.Context, r *types.Template) bool {
return svc.can(ctx, "render", r)
}
// CanReadUser checks if current user can read user
//
// This function is auto-generated
func (svc accessControl) CanReadUser(ctx context.Context, r *types.User) bool {
return svc.can(ctx, "read", r)
}
// CanUpdateUser checks if current user can update user
//
// This function is auto-generated
func (svc accessControl) CanUpdateUser(ctx context.Context, r *types.User) bool {
return svc.can(ctx, "update", r)
}
// CanDeleteUser checks if current user can delete user
//
// This function is auto-generated
func (svc accessControl) CanDeleteUser(ctx context.Context, r *types.User) bool {
return svc.can(ctx, "delete", r)
}
// CanSuspendUser checks if current user can suspend user
//
// This function is auto-generated
func (svc accessControl) CanSuspendUser(ctx context.Context, r *types.User) bool {
return svc.can(ctx, "suspend", r)
}
// CanUnsuspendUser checks if current user can unsuspend user
//
// This function is auto-generated
func (svc accessControl) CanUnsuspendUser(ctx context.Context, r *types.User) bool {
return svc.can(ctx, "unsuspend", r)
}
// CanUnmaskEmailOnUser checks if current user can unmask email
//
// This function is auto-generated
func (svc accessControl) CanUnmaskEmailOnUser(ctx context.Context, r *types.User) bool {
return svc.can(ctx, "email.unmask", r)
}
// CanUnmaskNameOnUser checks if current user can unmask name
//
// This function is auto-generated
func (svc accessControl) CanUnmaskNameOnUser(ctx context.Context, r *types.User) bool {
return svc.can(ctx, "name.unmask", r)
}
// CanImpersonateUser checks if current user can impersonate user
//
// This function is auto-generated
func (svc accessControl) CanImpersonateUser(ctx context.Context, r *types.User) bool {
return svc.can(ctx, "impersonate", r)
}
// CanManageCredentialsOnUser checks if current user can manage user's credentials
//
// This function is auto-generated
func (svc accessControl) CanManageCredentialsOnUser(ctx context.Context, r *types.User) bool {
return svc.can(ctx, "credentials.manage", r)
}
// CanReadDalConnection checks if current user can read connection
//
// This function is auto-generated
func (svc accessControl) CanReadDalConnection(ctx context.Context, r *types.DalConnection) bool {
return svc.can(ctx, "read", r)
}
// CanUpdateDalConnection checks if current user can update connection
//
// This function is auto-generated
func (svc accessControl) CanUpdateDalConnection(ctx context.Context, r *types.DalConnection) bool {
return svc.can(ctx, "update", r)
}
// CanDeleteDalConnection checks if current user can delete connection
//
// This function is auto-generated
func (svc accessControl) CanDeleteDalConnection(ctx context.Context, r *types.DalConnection) bool {
return svc.can(ctx, "delete", r)
}
// CanManageDalConfigOnDalConnection checks if current user can manage dal configuration
//
// This function is auto-generated
func (svc accessControl) CanManageDalConfigOnDalConnection(ctx context.Context, r *types.DalConnection) bool {
return svc.can(ctx, "dal-config.manage", r)
}
// CanGrant checks if current user can manage system permissions
//
// This function is auto-generated
func (svc accessControl) CanGrant(ctx context.Context) bool {
r := &types.Component{}
return svc.can(ctx, "grant", r)
}
// CanReadActionLog checks if current user can access to action log
//
// This function is auto-generated
func (svc accessControl) CanReadActionLog(ctx context.Context) bool {
r := &types.Component{}
return svc.can(ctx, "action-log.read", r)
}
// CanReadSettings checks if current user can read system settings
//
// This function is auto-generated
func (svc accessControl) CanReadSettings(ctx context.Context) bool {
r := &types.Component{}
return svc.can(ctx, "settings.read", r)
}
// CanManageSettings checks if current user can manage system settings
//
// This function is auto-generated
func (svc accessControl) CanManageSettings(ctx context.Context) bool {
r := &types.Component{}
return svc.can(ctx, "settings.manage", r)
}
// CanCreateAuthClient checks if current user can create auth clients
//
// This function is auto-generated
func (svc accessControl) CanCreateAuthClient(ctx context.Context) bool {
r := &types.Component{}
return svc.can(ctx, "auth-client.create", r)
}
// CanSearchAuthClients checks if current user can list, search or filter auth clients
//
// This function is auto-generated
func (svc accessControl) CanSearchAuthClients(ctx context.Context) bool {
r := &types.Component{}
return svc.can(ctx, "auth-clients.search", r)
}
// CanCreateRole checks if current user can create roles
//
// This function is auto-generated
func (svc accessControl) CanCreateRole(ctx context.Context) bool {
r := &types.Component{}
return svc.can(ctx, "role.create", r)
}
// CanSearchRoles checks if current user can list, search or filter roles
//
// This function is auto-generated
func (svc accessControl) CanSearchRoles(ctx context.Context) bool {
r := &types.Component{}
return svc.can(ctx, "roles.search", r)
}
// CanCreateUser checks if current user can create users
//
// This function is auto-generated
func (svc accessControl) CanCreateUser(ctx context.Context) bool {
r := &types.Component{}
return svc.can(ctx, "user.create", r)
}
// CanSearchUsers checks if current user can list, search or filter users
//
// This function is auto-generated
func (svc accessControl) CanSearchUsers(ctx context.Context) bool {
r := &types.Component{}
return svc.can(ctx, "users.search", r)
}
// CanCreateDalConnection checks if current user can create dal connections
//
// This function is auto-generated
func (svc accessControl) CanCreateDalConnection(ctx context.Context) bool {
r := &types.Component{}
return svc.can(ctx, "dal-connection.create", r)
}
// CanSearchDalConnections checks if current user can list, search or filter dal connections
//
// This function is auto-generated
func (svc accessControl) CanSearchDalConnections(ctx context.Context) bool {
r := &types.Component{}
return svc.can(ctx, "dal-connections.search", r)
}
// CanManageDalSensitivityLevel checks if current user can can manage dal sensitivity levels