MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / allows

Method allows

atomic-identity/src/delegation.rs:529–556  ·  view source on GitHub ↗

Check if an operation is allowed by this delegation.

(
        &self,
        permission: DelegationPermission,
        repository: Option<&str>,
        view: Option<&str>,
    )

Source from the content-addressed store, hash-verified

527
528 /// Check if an operation is allowed by this delegation.
529 pub fn allows(
530 &self,
531 permission: DelegationPermission,
532 repository: Option<&str>,
533 view: Option<&str>,
534 ) -> bool {
535 if !self.is_valid() {
536 return false;
537 }
538
539 if !self.scope.has_permission(permission) {
540 return false;
541 }
542
543 if let Some(repo) = repository {
544 if !self.scope.allows_repository(repo) {
545 return false;
546 }
547 }
548
549 if let Some(view_name) = view {
550 if !self.scope.allows_view(view_name) {
551 return false;
552 }
553 }
554
555 true
556 }
557
558 /// Get the data to be signed for this delegation.
559 pub fn signing_data(&self) -> Vec<u8> {

Callers

nothing calls this directly

Calls 4

has_permissionMethod · 0.80
allows_repositoryMethod · 0.80
allows_viewMethod · 0.80
is_validMethod · 0.45

Tested by

no test coverage detected