pub struct AccessControlManager { /* private fields */ }Expand description
Access control manager
Implementations§
Source§impl AccessControlManager
impl AccessControlManager
Sourcepub fn register_role(&mut self, role: Role)
pub fn register_role(&mut self, role: Role)
Register a role
Sourcepub fn create_user(
&mut self,
id: String,
username: String,
email: String,
) -> Result<User>
pub fn create_user( &mut self, id: String, username: String, email: String, ) -> Result<User>
Create a user
Sourcepub fn create_organization(
&mut self,
id: String,
name: String,
) -> Result<Organization>
pub fn create_organization( &mut self, id: String, name: String, ) -> Result<Organization>
Create an organization
Sourcepub fn get_organization(&self, org_id: &str) -> Option<&Organization>
pub fn get_organization(&self, org_id: &str) -> Option<&Organization>
Get an organization
Sourcepub fn set_package_ownership(&mut self, ownership: PackageOwnership)
pub fn set_package_ownership(&mut self, ownership: PackageOwnership)
Set package ownership
Sourcepub fn check_access(
&self,
user_id: &str,
package_name: &str,
permission: &Permission,
) -> AccessCheckResult
pub fn check_access( &self, user_id: &str, package_name: &str, permission: &Permission, ) -> AccessCheckResult
Check if user has permission for a package operation
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AccessControlManager
impl RefUnwindSafe for AccessControlManager
impl Send for AccessControlManager
impl Sync for AccessControlManager
impl Unpin for AccessControlManager
impl UnsafeUnpin for AccessControlManager
impl UnwindSafe for AccessControlManager
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more