Deny mutable access for hooks if the config says so
This commit is contained in:
parent
7f14639c1e
commit
7818b523b9
1 changed files with 4 additions and 0 deletions
|
@ -73,6 +73,10 @@ impl StoreIdAccessor for Aspect {
|
||||||
|
|
||||||
impl MutableHookDataAccessor for Aspect {
|
impl MutableHookDataAccessor for Aspect {
|
||||||
fn access_mut(&self, fle: &mut FileLockEntry) -> HookResult<()> {
|
fn access_mut(&self, fle: &mut FileLockEntry) -> HookResult<()> {
|
||||||
|
if !self.cfg.as_ref().map(|c| c.allow_mutable_hooks()).unwrap_or(false) {
|
||||||
|
return Err(HE::new(HEK::MutableHooksNotAllowed, None));
|
||||||
|
}
|
||||||
|
|
||||||
let accessors : Vec<HDA> = self.hooks.iter().map(|h| h.accessor()).collect();
|
let accessors : Vec<HDA> = self.hooks.iter().map(|h| h.accessor()).collect();
|
||||||
|
|
||||||
fn is_file_accessor(a: &HDA) -> bool {
|
fn is_file_accessor(a: &HDA) -> bool {
|
||||||
|
|
Loading…
Reference in a new issue