Chore: remove checks for whether RBAC is disabled (#73812)

* remove checks for whether access control is disabled, as it is always enabled now

* linting
This commit is contained in:
Ieva
2023-08-25 14:19:58 +01:00
committed by GitHub
parent 972da629ab
commit 6885b3d577
9 changed files with 30 additions and 72 deletions

View File

@@ -339,16 +339,12 @@ func (r *xormRepositoryImpl) Get(ctx context.Context, query *annotations.ItemQue
}
}
var acFilter acFilter
if !ac.IsDisabled(r.cfg) {
var err error
acFilter, err = r.getAccessControlFilter(query.SignedInUser)
if err != nil {
return err
}
sql.WriteString(fmt.Sprintf(" AND (%s)", acFilter.where))
params = append(params, acFilter.whereParams...)
acFilter, err := r.getAccessControlFilter(query.SignedInUser)
if err != nil {
return err
}
sql.WriteString(fmt.Sprintf(" AND (%s)", acFilter.where))
params = append(params, acFilter.whereParams...)
if query.Limit == 0 {
query.Limit = 100