Skip to content

refactor: use object_id instead of object_name in privilege

Егор Ивков requested to merge privilege-object-id into master

Summary

  • refactor: use object_id instead of object_name in privilege

The PrivilegeDef struct now looks like this:

/// Privilege definition.
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, Hash)]
pub struct PrivilegeDef {
    pub privilege: String,
    pub object_type: String,
    /// `-1` denotes an absense of a target object.
    /// Other values should be >= 0 and denote an existing target object.
    ///
    /// To get the value of this field as `Option<u32>` see [`Self::object_id`]
    pub object_id: i64,
    /// Id of the user or role to whom the privilege is granted.
    ///
    /// In tarantool users and roles are stored in the same space, which means a
    /// role and a user cannot have the same id or name.
    pub grantee_id: UserId,
    pub grantor_id: UserId,
    pub schema_version: u64,
}

Close #401 (closed)

Docs follow up docs#131 (closed)

Ensure that

  • New code is covered by tests
  • API is documented
  • Changelog is up to date
  • (if Lua API changed) Lua API version is bumped in luamod.rs
  • (if necessary) A follow-up doc issue is created in picodata/docs and linked here
Edited by Егор Ивков

Merge request reports