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
Loading
Please register or sign in to comment