mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdctl: sync README with etcdctl role command, add prefix example, fix typo
Fixes #7951
This commit is contained in:
parent
bd680c3302
commit
2f1467cb27
@ -961,25 +961,42 @@ RPC: RoleGrantPermission
|
||||
|
||||
#### Options
|
||||
|
||||
- from-key -- grant a permission of keys that are greater than or equal to the given key using byte compare
|
||||
|
||||
- prefix -- grant a prefix permission
|
||||
|
||||
#### Ouptut
|
||||
#### Output
|
||||
|
||||
`Role <role name> updated`.
|
||||
|
||||
#### Examples
|
||||
|
||||
Grant read and write permission on the key `foo` to role `myrole`:
|
||||
|
||||
```bash
|
||||
./etcdctl --user=root:123 role grant-permission myrole readwrite foo
|
||||
# Role myrole updated
|
||||
```
|
||||
|
||||
Grant read permission on the wildcard key pattern `foo/*` to role `myrole`:
|
||||
|
||||
```bash
|
||||
./etcdctl --user=root:123 role grant-permission --prefix myrole readwrite foo/
|
||||
# Role myrole updated
|
||||
```
|
||||
|
||||
### ROLE REVOKE-PERMISSION \<role name\> \<permission type\> \<key\> [endkey]
|
||||
|
||||
`role revoke-permission` revokes a key from a role.
|
||||
|
||||
RPC: RoleRevokePermission
|
||||
|
||||
#### Options
|
||||
|
||||
- from-key -- revoke a permission of keys that are greater than or equal to the given key using byte compare
|
||||
|
||||
- prefix -- revoke a prefix permission
|
||||
|
||||
#### Output
|
||||
|
||||
`Permission of key <key> is revoked from role <role name>` for single key. `Permission of range [<key>, <endkey>) is revoked from role <role name>` for a key range. Exit code is zero.
|
||||
|
Loading…
x
Reference in New Issue
Block a user