Struct kernel::storage_permissions::StoragePermissions
source · pub struct StoragePermissions { /* private fields */ }
Expand description
List of storage permissions for a storage user.
These identifiers signify what permissions a storage user has. The storage mechanism defines how the identifiers are assigned and how they relate to stored objects.
For simplicity, a we store to eight read and eight write permissions. The
first count
u32
values in permissions
are valid.
Mar, 2022: This interface is considered experimental and for initial prototyping. As we learn more about how these permissions are set and used we may want to revamp this interface.
Implementations§
source§impl StoragePermissions
impl StoragePermissions
sourcepub fn new_kernel_permissions(_cap: &dyn KerneluserStorageCapability) -> Self
pub fn new_kernel_permissions(_cap: &dyn KerneluserStorageCapability) -> Self
Create superuser permissions suitable for the kernel. This allows the kernel to read/update any stored item, and allows the kernel to write items that will not be accessible to any clients without superuser permissions.
sourcepub fn check_read_permission(&self, storage_id: u32) -> bool
pub fn check_read_permission(&self, storage_id: u32) -> bool
Check if this permission object grants read access to the specified
storage_id
. Returns true
if access is permitted, false
otherwise.
sourcepub fn check_write_permission(&self, storage_id: u32) -> bool
pub fn check_write_permission(&self, storage_id: u32) -> bool
Check if this permission object grants modify access to the specified
storage_id
. Returns true
if access is permitted, false
otherwise.
sourcepub fn get_write_id(&self) -> Option<u32>
pub fn get_write_id(&self) -> Option<u32>
Get the write_id
for saving items to the storage.
Trait Implementations§
source§impl Clone for StoragePermissions
impl Clone for StoragePermissions
source§fn clone(&self) -> StoragePermissions
fn clone(&self) -> StoragePermissions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more