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§
sourcefn can_attest(
&self,
who: &AttesterId,
ctype: &Ctype,
claim: &ClaimHash
) -> Result<Weight, DispatchError>
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).
sourcefn can_revoke(
&self,
who: &AttesterId,
ctype: &Ctype,
claim: &ClaimHash,
authorization_id: &AuthorizationId
) -> Result<Weight, DispatchError>
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).
sourcefn can_remove(
&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>
Decides whether the account is allowed to remove the attestation with
the authorization_id
and the access information provided by the sender
(&self).
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()
.
sourcefn can_attest_weight(&self) -> Weight
fn can_attest_weight(&self) -> Weight
The worst-case weight of can_attest
.
sourcefn can_revoke_weight(&self) -> Weight
fn can_revoke_weight(&self) -> Weight
The worst-case weight of can_revoke
.
sourcefn can_remove_weight(&self) -> Weight
fn can_remove_weight(&self) -> Weight
The worst-case weight of can_remove
.