Auth: Separate anonymous settings to its own struct (#97791)
separate anonymous settings to its own struct
This commit is contained in:
@@ -399,11 +399,11 @@ func rolePermissionsCollector(store db.DB) legacyTupleCollector {
|
||||
func anonymousRoleBindingsCollector(cfg *setting.Cfg, store db.DB) legacyTupleCollector {
|
||||
return func(ctx context.Context, orgID int64) (map[string]map[string]*openfgav1.TupleKey, error) {
|
||||
tuples := make(map[string]map[string]*openfgav1.TupleKey)
|
||||
object := zanzana.NewTupleEntry(zanzana.TypeRole, zanzana.TranslateBasicRole(cfg.AnonymousOrgRole), "")
|
||||
object := zanzana.NewTupleEntry(zanzana.TypeRole, zanzana.TranslateBasicRole(cfg.Anonymous.OrgRole), "")
|
||||
// Object should be set to delete obsolete permissions
|
||||
tuples[object] = make(map[string]*openfgav1.TupleKey)
|
||||
|
||||
o, err := getOrgByName(ctx, store, cfg.AnonymousOrgName)
|
||||
o, err := getOrgByName(ctx, store, cfg.Anonymous.OrgName)
|
||||
if err != nil {
|
||||
return tuples, nil
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ func NewZanzanaReconciler(cfg *setting.Cfg, client zanzana.Client, store db.DB,
|
||||
},
|
||||
}
|
||||
|
||||
if cfg.AnonymousEnabled {
|
||||
if cfg.Anonymous.Enabled {
|
||||
zanzanaReconciler.reconcilers = append(zanzanaReconciler.reconcilers,
|
||||
newResourceReconciler(
|
||||
"anonymous role binding",
|
||||
|
||||
Reference in New Issue
Block a user