Struct git_repository::Permissions
source · [−]pub struct Permissions {
pub git_dir: Access<Resource, ReadWrite>,
pub env: Environment,
pub config: Config,
}
Expand description
Permissions associated with various resources of a git repository
Fields
git_dir: Access<Resource, ReadWrite>
Control how a git-dir can be used.
Note that a repository won’t be usable at all unless read and write permissions are given.
env: Environment
Permissions related to the environment
config: Config
Permissions related to the handling of git configuration.
Implementations
sourceimpl Permissions
impl Permissions
sourcepub fn strict() -> Self
pub fn strict() -> Self
Return permissions similar to what git does when the repository isn’t owned by the current user, thus refusing all operations in it.
sourcepub fn secure() -> Self
pub fn secure() -> Self
Return permissions that will not include configuration files not owned by the current user, but trust system and global configuration files along with those which are owned by the current user.
This allows to read and write repositories even if they aren’t owned by the current user, but avoid using
anything else that could cause us to write into unknown locations or use programs beyond our PATH
.
Trait Implementations
sourceimpl Clone for Permissions
impl Clone for Permissions
sourcefn clone(&self) -> Permissions
fn clone(&self) -> Permissions
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Permissions
impl Debug for Permissions
sourceimpl Default for Permissions
impl Default for Permissions
sourceimpl DefaultForLevel for Permissions
impl DefaultForLevel for Permissions
sourcefn default_for_level(level: Trust) -> Self
fn default_for_level(level: Trust) -> Self
Produce a default value for the given trust level
.
Auto Trait Implementations
impl RefUnwindSafe for Permissions
impl Send for Permissions
impl Sync for Permissions
impl Unpin for Permissions
impl UnwindSafe for Permissions
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more