pkg/rbac/auth.go
Consider simplifying this complex logical expression. Open
Open
if attr.IsResourceRequest() && (attr.GetResource() == "members" ||
attr.GetResource() == "environments" || attr.GetResource() == "users" ||
attr.GetResource() == "personalaccesstokens" ||
(attr.GetResource() == "accesstokens" && attr.GetVerb() == "delete")) {
Method authorizer.Authorize
has 8 return statements (exceeds 4 allowed). Open
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 {