Skip to content

Commit

Permalink
fix: fix readme to explain actions of putting policy
Browse files Browse the repository at this point in the history
  • Loading branch information
flywukong committed Oct 31, 2023
1 parent d89e491 commit e43e0c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ The group policy actions can be "update", "delete" or all, update indicates the

The policy effect can set to be "allow" or "deny" by --effect

If it is an object policy, actions can be the following: create, delete, copy, get, execute, list, update or all.
If it is a bucket policy, actions can be the following: delete, update, create, createObj, deleteObj, copyObj, getObj, executeObj, list or all. The actions which
contain Obj means it is an action for the objects in the bucket. If it is a group policy, actions can be the following: update, delete or all.

Put policy examples:
```
// grant object operation permissions to a group
Expand Down
4 changes: 2 additions & 2 deletions cmd/cmd_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ $ gnfd-cmd policy put --groupId 111 --actions get,delete grn:o::gnfd-bucket/gnfd
Value: "",
Usage: "set the actions of the policy," +
"if it is an object policy, actions can be the following: create, delete, copy, get, execute, list, update or all," +
"if it is a bucket policy, actions can be the following: delete, update, create, createObj,deleteObj, copyObj, getObj, executeObj, list or all" +
"if it is a bucket policy, actions can be the following: delete, update, create, createObj,deleteObj, copyObj, getObj, executeObj, list or all." +
" the actions which contain Obj means it is a action for the objects in the bucket, for example," +
" the deleteObj means grant the permission of delete Objects in the bucket" +
"if it is a group policy, actions can be the following: update, delete or all, update indicates the update-group-member action" +
Expand Down Expand Up @@ -164,7 +164,7 @@ func putPolicy(ctx *cli.Context) error {
}
}

// if the actions contains object actions of bucket policy, isObjectActionInBucketPolicy will be true
// if the actions contain object actions of bucket policy, isObjectActionInBucketPolicy will be set as true
actions, isObjectActionInBucketPolicy, err := parseActions(ctx, resourceType)
if err != nil {
return toCmdErr(err)
Expand Down

0 comments on commit e43e0c2

Please sign in to comment.