UserStorage: Improve error handling (#104025)
This commit is contained in:
@@ -94,7 +94,7 @@ func (b *UserStorageAPIBuilder) GetAuthorizer() authorizer.Authorizer {
|
||||
switch attr.GetVerb() {
|
||||
case "create":
|
||||
// Create requests are validated later since we don't have access to the resource name
|
||||
return authorizer.DecisionNoOpinion, "", nil
|
||||
return authorizer.DecisionAllow, "", nil
|
||||
case "get", "delete", "patch", "update":
|
||||
// Only allow the user to access their own settings
|
||||
if !compareResourceNameAndUserUID(attr.GetName(), u) {
|
||||
|
||||
@@ -43,7 +43,7 @@ func TestAuthorizer(t *testing.T) {
|
||||
requesterID: "123",
|
||||
objectName: "",
|
||||
verb: "create",
|
||||
decision: authorizer.DecisionNoOpinion,
|
||||
decision: authorizer.DecisionAllow,
|
||||
},
|
||||
{
|
||||
name: "forbidden action",
|
||||
|
||||
Reference in New Issue
Block a user