pub struct ObjectPermission {
pub id: Option<i32>,
pub url: Option<String>,
pub display_url: Option<String>,
pub display: Option<String>,
pub name: String,
pub description: Option<String>,
pub enabled: Option<bool>,
pub object_types: Vec<String>,
pub actions: Vec<String>,
pub constraints: Option<Option<Value>>,
pub groups: Option<Vec<NestedGroup>>,
pub users: Option<Vec<NestedUser>>,
}Expand description
ObjectPermission : Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144)
Fields§
§id: Option<i32>§url: Option<String>§display_url: Option<String>§display: Option<String>§name: String§description: Option<String>§enabled: Option<bool>§object_types: Vec<String>§actions: Vec<String>The list of actions granted by this permission
constraints: Option<Option<Value>>Queryset filter matching the applicable objects of the selected type(s)
groups: Option<Vec<NestedGroup>>§users: Option<Vec<NestedUser>>Implementations§
Source§impl ObjectPermission
impl ObjectPermission
Sourcepub fn new(
name: String,
object_types: Vec<String>,
actions: Vec<String>,
) -> ObjectPermission
pub fn new( name: String, object_types: Vec<String>, actions: Vec<String>, ) -> ObjectPermission
Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144)
Trait Implementations§
Source§impl Clone for ObjectPermission
impl Clone for ObjectPermission
Source§fn clone(&self) -> ObjectPermission
fn clone(&self) -> ObjectPermission
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ObjectPermission
impl Debug for ObjectPermission
Source§impl Default for ObjectPermission
impl Default for ObjectPermission
Source§fn default() -> ObjectPermission
fn default() -> ObjectPermission
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ObjectPermission
impl<'de> Deserialize<'de> for ObjectPermission
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ObjectPermission
impl PartialEq for ObjectPermission
Source§impl Serialize for ObjectPermission
impl Serialize for ObjectPermission
impl StructuralPartialEq for ObjectPermission
Auto Trait Implementations§
impl Freeze for ObjectPermission
impl RefUnwindSafe for ObjectPermission
impl Send for ObjectPermission
impl Sync for ObjectPermission
impl Unpin for ObjectPermission
impl UnwindSafe for ObjectPermission
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