horizoncd/horizon

View on GitHub
pkg/rbac/auth.go

Summary

Maintainability
A
1 hr
Test Coverage
C
71%

Consider simplifying this complex logical expression.
Open

    if attr.IsResourceRequest() && (attr.GetResource() == "members" ||
        attr.GetResource() == "environments" || attr.GetResource() == "users" ||
        attr.GetResource() == "personalaccesstokens" ||
        (attr.GetResource() == "accesstokens" && attr.GetVerb() == "delete")) {
Severity: Major
Found in pkg/rbac/auth.go - About 1 hr to fix

    Method authorizer.Authorize has 8 return statements (exceeds 4 allowed).
    Open

    func (a *authorizer) Authorize(ctx context.Context, attr auth.Attributes) (auth.Decision,
        string, error) {
        // 0. check (admin allows everything, and some are not checked)
        currentUser, err := common.UserFromContext(ctx)
        if err != nil {
    Severity: Major
    Found in pkg/rbac/auth.go - About 50 mins to fix

      There are no issues that match your filters.

      Category
      Status