Skip to content

Commit 57c9148

Browse files
committed
fix parse policy
1 parent 6993cd6 commit 57c9148

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

restapi/admin_policies.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,7 @@ func getRemovePolicyResponse(params admin_api.RemovePolicyParams) error {
158158
// policy must be string in json format, in the future this will change
159159
// to a Policy struct{} - https://github.com/minio/minio/issues/9171
160160
func addPolicy(ctx context.Context, client MinioAdmin, name, policy string) (*models.Policy, error) {
161-
policyB, err := json.Marshal(policy)
162-
if err != nil {
163-
return nil, err
164-
}
165-
iamp, err := iampolicy.ParseConfig(bytes.NewReader(policyB))
161+
iamp, err := iampolicy.ParseConfig(bytes.NewReader([]byte(policy)))
166162
if err != nil {
167163
return nil, err
168164
}

0 commit comments

Comments
 (0)