Skip to content

Commit

Permalink
fix(register): shortcut permissions check when anyone can write to Re…
Browse files Browse the repository at this point in the history
…gister
  • Loading branch information
bochaco committed Mar 23, 2024
1 parent 859fa36 commit fd95128
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sn_registers/src/register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ impl Register {

/// Check if a register op is valid for our current register
pub fn check_register_op(&self, op: &RegisterOp) -> Result<()> {
if self.permissions.can_anyone_write() {
return Ok(()); // anyone can write, so no need to check the signature
}
self.check_user_permissions(op.source)?;
op.verify_signature(&op.source)
}
Expand Down

0 comments on commit fd95128

Please sign in to comment.