#[repr(u8)]pub enum Permission {
Pull,
Triage,
Push,
Maintain,
Admin,
Custom(RoleName),
}Expand description
A repository permission GitHub can grant.
The five built-in names are plain strings. A custom repository role is
the object {"custom":"<role name>"}.
Variants§
Pull
Read and clone.
Triage
Read, plus manage issues and pull requests.
Push
Read and write.
Maintain
Write, plus manage the repository without sensitive actions.
Admin
Full access.
Custom(RoleName)
A custom repository role of the organization.
Implementations§
Source§impl Permission
impl Permission
Sourcepub fn from_role_name(raw: &str) -> Option<Self>
pub fn from_role_name(raw: &str) -> Option<Self>
Read the role name GitHub reports for a grant.
GitHub spells the built-in roles read and write in some
responses. Any other name is a custom role.
Sourcepub fn observe(role: &str, flagged: Option<Self>) -> Observed<Self>
pub fn observe(role: &str, flagged: Option<Self>) -> Observed<Self>
Combine the role name and the highest set permission flag of a grant.
A role name that is not a built-in role is a custom role. Otherwise the flag wins, and the role name is the fallback.
Sourcepub const fn invitation_name(&self) -> Option<&'static str>
pub const fn invitation_name(&self) -> Option<&'static str>
The name an invitation update takes, which has no custom roles.
Trait Implementations§
Source§impl Clone for Permission
impl Clone for Permission
Source§fn clone(&self) -> Permission
fn clone(&self) -> Permission
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 Permission
impl Debug for Permission
Source§impl Display for Permission
impl Display for Permission
impl Eq for Permission
Source§impl<'ʄ> Facet<'ʄ> for Permission
impl<'ʄ> Facet<'ʄ> for Permission
Source§impl FromStr for Permission
impl FromStr for Permission
Source§impl PartialEq for Permission
impl PartialEq for Permission
impl StructuralPartialEq for Permission
Source§impl TryFrom<&Permission> for Value
impl TryFrom<&Permission> for Value
Source§type Error = PermissionError
type Error = PermissionError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for Permission
impl RefUnwindSafe for Permission
impl Send for Permission
impl Sync for Permission
impl Unpin for Permission
impl UnsafeUnpin for Permission
impl UnwindSafe for Permission
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.