[Tarantool-patches] [PATCH] box: user.grant error should be versatile
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Fri Feb 21 01:44:33 MSK 2020
Hi! Thanks for the patch!
On 19/02/2020 17:35, Maria Khaydich wrote:
> Error message on granted privileges was not flexible and
> did not distinguish between universal or any other priviliges
priviliges -> privileges
> leaving either 'nil' or simply '' at the end.
>
> Closes #714
> > diff --git a/test/box/access.result b/test/box/access.result
> index 9554991ad..be8b1c521 100644
> --- a/test/box/access.result
> +++ b/test/box/access.result
> @@ -532,7 +532,7 @@ box.space._priv:select{id}
> ...
> box.schema.user.grant('user', 'read', 'universe')
> ---
> -- error: User 'user' already has read access on universe ''
> +- error: User 'user' already has read access on universe
> ...
> box.space._priv:select{id}
> ---
> @@ -738,7 +738,7 @@ box.schema.user.grant('guest', 'read,write,execute', 'universe')
> ...
> box.schema.user.grant('guest', 'read,write,execute', 'universe')
> ---
> -- error: User 'guest' already has read,write,execute access on universe ''
> +- error: User 'guest' already has read,write,execute access on universe
> ...
> box.schema.user.grant('guest', 'read,write,execute', 'universe', '', { if_not_exists = true })
> ---
> @@ -2108,3 +2108,29 @@ box.space._priv:delete{1, 'universe', 0}
> ---
> - error: 'Incorrect grant arguments: can''t revoke universe from the admin user'
> ...
> +--
> +-- gh-714: box.schema.user.grant error should be versatile,
> +-- i.e. error on universally granted privileges shouldn't
> +-- include any redundant details and/or symbols
> +--
> +box.schema.user.grant('guest', 'read,write,execute', 'universe')
> +---
> +...
> +box.schema.user.grant('guest', 'read,write,execute', 'universe')
> +---
> +- error: User 'guest' already has read,write,execute access on universe
> +...
> +-- expected behavior of grant() error shouldn't change otherwise
It would be good to have a dot in the end of this sentence and of the
previous comment. And to start the sentence with a capital letter.
Although I can't block the patch because of this nit, so LGTM and up
to you.
More information about the Tarantool-patches
mailing list