Config: Remove setting editors_can_admin (#101607)
* Remove editors can admin * delete file * add ac_test back * Add linting ignore * more static ignore
This commit is contained in:
@@ -31,15 +31,11 @@ func (s *Service) getUsageStats(ctx context.Context) (map[string]any, error) {
|
||||
// FIXME: Move this to accesscontrol OSS.
|
||||
// FIXME: Access Control OSS usage stats is currently disabled if Enterprise is enabled.
|
||||
m["stats.authz.viewers_can_edit.count"] = 0
|
||||
//nolint:staticcheck // ViewersCanEdit is deprecated but still used for backward compatibility
|
||||
if s.cfg.ViewersCanEdit {
|
||||
m["stats.authz.viewers_can_edit.count"] = 1
|
||||
}
|
||||
|
||||
m["stats.authz.editors_can_admin.count"] = 0
|
||||
if s.cfg.EditorsCanAdmin {
|
||||
m["stats.authz.editors_can_admin.count"] = 1
|
||||
}
|
||||
|
||||
for _, client := range s.clients {
|
||||
if usac, ok := client.(authn.UsageStatClient); ok {
|
||||
clientStats, err := usac.UsageStatFn(ctx)
|
||||
|
||||
@@ -23,7 +23,7 @@ func TestService_getUsageStats(t *testing.T) {
|
||||
svc.cfg.AuthProxy.Enabled = true
|
||||
svc.cfg.JWTAuth.Enabled = true
|
||||
svc.cfg.LDAPAuthEnabled = true
|
||||
svc.cfg.EditorsCanAdmin = true
|
||||
//nolint:staticcheck
|
||||
svc.cfg.ViewersCanEdit = true
|
||||
|
||||
got, err := svc.getUsageStats(context.Background())
|
||||
@@ -35,7 +35,6 @@ func TestService_getUsageStats(t *testing.T) {
|
||||
"stats.auth_enabled.jwt.count": 1,
|
||||
"stats.auth_enabled.ldap.count": 1,
|
||||
"stats.auth_enabled.login_form.count": 1,
|
||||
"stats.authz.editors_can_admin.count": 1,
|
||||
"stats.authz.viewers_can_edit.count": 1,
|
||||
"stats.test.enabled.count": 1,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user