Struct git_repository::Permissions
source · pub struct Permissions {
pub env: Environment,
pub config: Config,
}
Expand description
Permissions associated with various resources of a git repository
Fields§
§env: Environment
Permissions related to the environment
config: Config
Permissions related to the handling of git configuration.
Implementations§
source§impl Permissions
impl Permissions
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
.
Examples found in repository?
src/repository/permissions.rs (line 159)
156 157 158 159 160 161 162 163 164 165 166 167
fn default_for_level(level: Trust) -> Self {
match level {
Trust::Full => Permissions::all(),
Trust::Reduced => Permissions::secure(),
}
}
}
impl Default for Permissions {
fn default() -> Self {
Permissions::secure()
}
sourcepub fn all() -> Self
pub fn all() -> Self
Everything is allowed with this set of permissions, thus we read all configuration and do what git typically does with owned repositories.
Trait Implementations§
source§impl Clone for Permissions
impl Clone for Permissions
source§fn clone(&self) -> Permissions
fn clone(&self) -> Permissions
Returns a copy of the value. Read more
1.0.0 · 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 Permissions
impl Debug for Permissions
source§impl Default for Permissions
impl Default for Permissions
source§impl DefaultForLevel for Permissions
impl DefaultForLevel for Permissions
source§fn default_for_level(level: Trust) -> Self
fn default_for_level(level: Trust) -> Self
Produce a default value for the given trust
level
.