added s3 iam DeleteBucket permission management (#5599)
This commit is contained in:
committed by
GitHub
parent
54f3913bed
commit
f6e8a9bf9c
@@ -317,6 +317,7 @@ func (iam *IdentityAccessManagement) Auth(f http.HandlerFunc, action Action) htt
|
||||
}
|
||||
|
||||
identity, errCode := iam.authRequest(r, action)
|
||||
glog.V(3).Infof("auth error: %v", errCode)
|
||||
if errCode == s3err.ErrNone {
|
||||
if identity != nil && identity.Name != "" {
|
||||
r.Header.Set(s3_constants.AmzIdentityId, identity.Name)
|
||||
@@ -453,6 +454,7 @@ func (identity *Identity) canDo(action Action, bucket string, objectKey string)
|
||||
}
|
||||
}
|
||||
if bucket == "" {
|
||||
glog.V(3).Infof("identity %s is not allowed to perform action %s on %s -- bucket is empty", identity.Name, action, bucket+objectKey)
|
||||
return false
|
||||
}
|
||||
target := string(action) + ":" + bucket + objectKey
|
||||
@@ -477,6 +479,8 @@ func (identity *Identity) canDo(action Action, bucket string, objectKey string)
|
||||
}
|
||||
}
|
||||
}
|
||||
//log error
|
||||
glog.V(3).Infof("identity %s is not allowed to perform action %s on %s", identity.Name, action, bucket+objectKey)
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user