Skip to content

Commit

Permalink
Fixes from PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
dopey committed Jul 3, 2021
1 parent 77fdfc9 commit 5679c99
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
12 changes: 0 additions & 12 deletions authority/admin/api/middleware.go
Expand Up @@ -52,15 +52,3 @@ const (
// adminContextKey account key
adminContextKey = ContextKey("admin")
)

/*
// adminFromContext searches the context for the token. Returns the
// token or an error.
func adminFromContext(ctx context.Context) (*linkedca.Admin, error) {
val, ok := ctx.Value(adminContextKey).(*linkedca.Admin)
if !ok || val == nil {
return nil, admin.NewErrorISE("admin not in context")
}
return val, nil
}
*/
2 changes: 1 addition & 1 deletion authority/administrator/collection.go
Expand Up @@ -184,7 +184,7 @@ func (c *Collection) Update(id string, nu *linkedca.Admin) (*linkedca.Admin, err
return nil, admin.NewError(admin.ErrorNotFoundType, "admin %s not found", adm.Id)
}
if adm.Type == nu.Type {
return nil, admin.NewError(admin.ErrorBadRequestType, "admin %s already has type %s", id, adm.Type)
return adm, nil
}
if adm.Type == linkedca.Admin_SUPER_ADMIN && c.SuperCount() == 1 {
return nil, admin.NewError(admin.ErrorBadRequestType, "cannot change role of last super admin")
Expand Down

0 comments on commit 5679c99

Please sign in to comment.