pub struct PermissionConverter { /* private fields */ }Expand description
Permission converter for transforming legacy permissions
Implementations§
Source§impl PermissionConverter
impl PermissionConverter
Sourcepub fn new(
id_prefix: String,
normalize_actions: bool,
normalize_resources: bool,
) -> Self
pub fn new( id_prefix: String, normalize_actions: bool, normalize_resources: bool, ) -> Self
Create new permission converter
Sourcepub fn convert_permission(
&self,
legacy_permission: &LegacyPermission,
) -> Result<ConvertedPermission, MigrationError>
pub fn convert_permission( &self, legacy_permission: &LegacyPermission, ) -> Result<ConvertedPermission, MigrationError>
Convert legacy permission to role-system v1.0 format
Sourcepub fn convert_permissions(
&self,
legacy_permissions: &[LegacyPermission],
) -> Result<Vec<ConvertedPermission>, MigrationError>
pub fn convert_permissions( &self, legacy_permissions: &[LegacyPermission], ) -> Result<Vec<ConvertedPermission>, MigrationError>
Convert multiple permissions
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PermissionConverter
impl RefUnwindSafe for PermissionConverter
impl Send for PermissionConverter
impl Sync for PermissionConverter
impl Unpin for PermissionConverter
impl UnwindSafe for PermissionConverter
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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