final class PrivilegeChecks
Restricted visibility: declared "@visibility SqlSemantics\Platform\MySql". Code outside that scope must not name this declaration.

Derives the facts of the privilege list, level and object of GRANT and REVOKE.

Rule: MYSQL-PRIVILEGE-CHECKS-001. A privilege fits a level as sql/auth/auth_acls.h and the server's GRANT path (sql_parse.cc, mysql_grant, mysql_table_grant, mysql_routine_grant) state: every static privilege fits the global level; a database takes DB_ACLS (ER_WRONG_USAGE otherwise), a table TABLE_ACLS and a routine PROC_ACLS (ER_ILLEGAL_GRANT_FOR_TABLE otherwise); a column list fits a table only (ER_ILLEGAL_GRANT_FOR_TABLE, or a syntax error after FUNCTION or PROCEDURE); FUNCTION and PROCEDURE need a routine name (ER_ILLEGAL_GRANT_FOR_TABLE); a dynamic privilege fits the global level only (ER_ILLEGAL_PRIVILEGE_LEVEL, a warning under REVOKE IF EXISTS). ALL fits every level. In a privilege list a role written with a host is a RoleOrPrivilegeMismatch; in a role list a static privilege or a dynamic privilege written with columns is one. The table of a level resolves by CORE-TABLE-LOOKUP-001 and contributes the slots of its declaration; a name a complete context does not declare is MissingTable for GRANT, except that GRANT of CREATE or ALL without column privileges and every REVOKE accept it as AbsentGrantTable. A column of a GRANT column privilege that the completely declared table does not have is UnknownGrantColumn. Precision: every slot of a declared table is a known type. Terminates: one pass over the privileges and the columns. Source: https://dev.mysql.com/doc/refman/8.4/en/grant.html, https://dev.mysql.com/doc/refman/8.4/en/revoke.html. Status: Implemented.

Methods§

public function revoke(
    Derivation $derivation,
    list<Grantable> $privileges,
    ObjectKind $kind,
    PrivilegeLevel $level,
    bool $ifExists,
): void
public function level(
    Derivation $derivation,
    list<Grantable> $privileges,
    ObjectKind $kind,
    PrivilegeLevel $level,
    bool $lenient,
): void
public function fit(
    Derivation $derivation,
    StaticPrivilege $privilege,
    ObjectKind $kind,
    PrivilegeLevel $level,
): void

Test cases 1§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1

Relations§

Instantiated in 4
Method calls 4