#[repr(C)]
pub struct st_grant_info { pub grant_table_user: *mut GRANT_TABLE, pub grant_table_role: *mut GRANT_TABLE, pub grant_public: *mut GRANT_TABLE, pub version: uint, pub privilege: Type, pub want_privilege: Type, pub orig_want_privilege: Type, pub m_internal: GRANT_INTERNAL_INFO, }
Expand description

The current state of the privilege checking process for the current

user, SQL statement and SQL object.

@details The privilege checking process is divided into phases depending on the level of the privilege to be checked and the type of object to be accessed. Due to the mentioned scattering of privilege checking functionality, it is necessary to keep track of the state of the process. This information is stored in privilege, want_privilege, and orig_want_privilege.

A GRANT_INFO also serves as a cache of the privilege hash tables. Relevant members are grant_table and version.

Fields§

§grant_table_user: *mut GRANT_TABLE

A copy of the privilege information regarding the current host,

database, object and user.

@details The version of this copy is found in GRANT_INFO::version.

§grant_table_role: *mut GRANT_TABLE§grant_public: *mut GRANT_TABLE§version: uint

Used for cache invalidation when caching privilege information.

@details The privilege information is stored on disk, with dedicated caches residing in memory: table-level and column-level privileges, respectively, have their own dedicated caches.

The GRANT_INFO works as a level 1 cache with this member updated to the current value of the global variable @c grant_version (@c static variable in sql_acl.cc). It is updated Whenever the GRANT_INFO is refreshed from the level 2 cache. The level 2 cache is the @c column_priv_hash structure (@c static variable in sql_acl.cc)

@see grant_version

§privilege: Type

The set of privileges that the current user has fulfilled for a

certain host, database, and object.

@details This field is continually updated throughout the access checking process. In each step the “wanted privilege” is checked against the fulfilled privileges. When/if the intersection of these sets is empty, access is granted.

The set is implemented as a bitmap, with the bits defined in sql_acl.h.

§want_privilege: Type

the set of privileges that the current user needs to fulfil in

order to carry out the requested operation.

§orig_want_privilege: Type

Stores the requested access acl of top level tables list. Is used to check access rights to the underlying tables of a view.

§m_internal: GRANT_INTERNAL_INFO

The grant state for internal tables.

Implementations§

source§

impl st_grant_info

source

pub unsafe fn read( &mut self, sctx: *const Security_context, db: *const c_char, table: *const c_char )

source

pub unsafe fn all_privilege(&mut self) -> Type

Trait Implementations§

source§

impl Debug for st_grant_info

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.