pub struct CheckAccessRules {
pub database: String,
pub uid: OdooId,
pub password: String,
pub model: String,
pub ids: OdooIds,
pub operation: AccessOperation,
}
Expand description
Check model access rules (according to ir.rule
)
This method checks against ir.rule
, e.g. advanced domain-based CRUD rules.
You should also call CheckAccessRights
in order to determine if any
basic CRUD/group rights apply to this model/user.
NOTE: If the access check fails, an API error will be returned. To determine if the rules passed, check for the “Success” enum variant on the response.
WARNING: This method currently raises an API exception on success. This issue will be fixed in a future release. For now, you may check for
§Example
use odoo_api::service::orm::AccessOperation;
client.check_access_rules(
"res.partner",
vec![1, 2], // records
AccessOperation::Unlink,
).send()?;
See: odoo/models.py
Fields§
§database: String
The database name (auto-filled by OdooClient
)
uid: OdooId
The user id (auto-filled by OdooClient
)
password: String
The user password (auto-filled by OdooClient
)
model: String
The Odoo model
ids: OdooIds
The records to be checked
operation: AccessOperation
The CRUD operation to check
Trait Implementations§
Source§impl Debug for CheckAccessRules
impl Debug for CheckAccessRules
Source§impl JsonRpcParams for CheckAccessRules
impl JsonRpcParams for CheckAccessRules
type Container<T> = OdooOrmContainer<CheckAccessRules>
type Response = CheckAccessRulesResponse
fn build(self, id: JsonRpcId) -> JsonRpcRequest<Self>
Source§impl OdooOrmMethod for CheckAccessRules
impl OdooOrmMethod for CheckAccessRules
Source§fn endpoint(&self) -> &'static str
fn endpoint(&self) -> &'static str
Describe the “ORM” method endpoint (e.g., “/web/session/authenticate”)
Source§fn method(&self) -> &'static str
fn method(&self) -> &'static str
Return the model method name (e.g., “read_group” or “create”)
Source§fn _build(self, id: JsonRpcId) -> JsonRpcRequest<Self>
fn _build(self, id: JsonRpcId) -> JsonRpcRequest<Self>
Build
self
into a full JsonRpcRequest
Auto Trait Implementations§
impl Freeze for CheckAccessRules
impl RefUnwindSafe for CheckAccessRules
impl Send for CheckAccessRules
impl Sync for CheckAccessRules
impl Unpin for CheckAccessRules
impl UnwindSafe for CheckAccessRules
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more