pub trait AttestationAccessControl<AttesterId, AuthorizationId, Ctype, ClaimHash> {
    // Required methods
    fn can_attest(
        &self,
        who: &AttesterId,
        ctype: &Ctype,
        claim: &ClaimHash
    ) -> Result<Weight, DispatchError>;
    fn can_revoke(
        &self,
        who: &AttesterId,
        ctype: &Ctype,
        claim: &ClaimHash,
        authorization_id: &AuthorizationId
    ) -> Result<Weight, DispatchError>;
    fn can_remove(
        &self,
        who: &AttesterId,
        ctype: &Ctype,
        claim: &ClaimHash,
        authorization_id: &AuthorizationId
    ) -> Result<Weight, DispatchError>;
    fn authorization_id(&self) -> AuthorizationId;
    fn can_attest_weight(&self) -> Weight;
    fn can_revoke_weight(&self) -> Weight;
    fn can_remove_weight(&self) -> Weight;
}
Expand description

Allow for more complex schemes on who can attest, revoke and remove.

Required Methods§

source

fn can_attest( &self, who: &AttesterId, ctype: &Ctype, claim: &ClaimHash ) -> Result<Weight, DispatchError>

Decides whether the account is allowed to attest with the given information provided by the sender (&self).

source

fn can_revoke( &self, who: &AttesterId, ctype: &Ctype, claim: &ClaimHash, authorization_id: &AuthorizationId ) -> Result<Weight, DispatchError>

Decides whether the account is allowed to revoke the attestation with the authorization_id and the access information provided by the sender (&self).

source

fn can_remove( &self, who: &AttesterId, ctype: &Ctype, claim: &ClaimHash, authorization_id: &AuthorizationId ) -> Result<Weight, DispatchError>

Decides whether the account is allowed to remove the attestation with the authorization_id and the access information provided by the sender (&self).

source

fn authorization_id(&self) -> AuthorizationId

The authorization ID that the sender provided. This will be used for new attestations.

NOTE: This method must not read storage or do any heavy computation since it’s not covered by the weight returned by self.weight().

source

fn can_attest_weight(&self) -> Weight

The worst-case weight of can_attest.

source

fn can_revoke_weight(&self) -> Weight

The worst-case weight of can_revoke.

source

fn can_remove_weight(&self) -> Weight

The worst-case weight of can_remove.

Implementations on Foreign Types§

source§

impl<AttesterId, AuthorizationId, Ctype, ClaimHash> AttestationAccessControl<AttesterId, AuthorizationId, Ctype, ClaimHash> for ()where AuthorizationId: Default,

source§

fn can_attest( &self, _who: &AttesterId, _ctype: &Ctype, _claim: &ClaimHash ) -> Result<Weight, DispatchError>

source§

fn can_revoke( &self, _who: &AttesterId, _ctype: &Ctype, _claim: &ClaimHash, _authorization_id: &AuthorizationId ) -> Result<Weight, DispatchError>

source§

fn can_remove( &self, _who: &AttesterId, _ctype: &Ctype, _claim: &ClaimHash, _authorization_id: &AuthorizationId ) -> Result<Weight, DispatchError>

source§

fn authorization_id(&self) -> AuthorizationId

source§

fn can_attest_weight(&self) -> Weight

source§

fn can_revoke_weight(&self) -> Weight

source§

fn can_remove_weight(&self) -> Weight

Implementors§

source§

impl<T> AttestationAccessControl<<T as Config>::AttesterId, <T as Config>::AuthorizationId, <T as Config>::Hash, <T as Config>::Hash> for MockAccessControl<T>where T: Config<AuthorizationId = <T as Config>::AttesterId>,