Skip to content
Snippets Groups Projects
Commit 2cb4136f authored by Vladimir Davydov's avatar Vladimir Davydov Committed by Vladimir Davydov
Browse files

alter: refactor ddl access checks

access_check_ddl() uses access_find() to look up the access structure of
the altered object by id, but the caller usually already knows what
object is altered so the second look up is redundant. Let's pass an
access struct to access_check_ddl() instead of an object id and make
access_find() private to src/box/user.cc, as it used to be.

Note that in priv_def_check(), we first call access_check_ddl() and only
then look up the target object to do some extra checks but we can
reverse the order since it doesn't change anything per se. This allows
us to get rid of schema_find_name(), which performed yet another extra
object lookup.

The goal of this cleanup is to simplify addition of new schema object
types, which is necessary to implement new privileges for SQL and Lua
code execution.

Needed for #8803

NO_DOC=refactoring
NO_TEST=refactoring
NO_CHANGELOG=refactoring
parent d9577855
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment