pub trait PublicCredentialsAccessControl<AttesterId, AuthorizationId, Ctype, CredentialId> {
// Required methods
fn can_issue(
&self,
who: &AttesterId,
ctype: &Ctype,
credential_id: &CredentialId
) -> Result<Weight, DispatchError>;
fn can_revoke(
&self,
who: &AttesterId,
ctype: &Ctype,
credential_id: &CredentialId,
authorization_id: &AuthorizationId
) -> Result<Weight, DispatchError>;
fn can_unrevoke(
&self,
who: &AttesterId,
ctype: &Ctype,
credential_id: &CredentialId,
authorization_id: &AuthorizationId
) -> Result<Weight, DispatchError>;
fn can_remove(
&self,
who: &AttesterId,
ctype: &Ctype,
credential_id: &CredentialId,
authorization_id: &AuthorizationId
) -> Result<Weight, DispatchError>;
fn authorization_id(&self) -> AuthorizationId;
fn can_issue_weight(&self) -> Weight;
fn can_revoke_weight(&self) -> Weight;
fn can_unrevoke_weight(&self) -> Weight;
fn can_remove_weight(&self) -> Weight;
}
Required Methods§
sourcefn can_issue(
&self,
who: &AttesterId,
ctype: &Ctype,
credential_id: &CredentialId
) -> Result<Weight, DispatchError>
fn can_issue( &self, who: &AttesterId, ctype: &Ctype, credential_id: &CredentialId ) -> Result<Weight, DispatchError>
Decides whether the account is allowed to issue a credential with the given information provided by the sender (&self).
sourcefn can_revoke(
&self,
who: &AttesterId,
ctype: &Ctype,
credential_id: &CredentialId,
authorization_id: &AuthorizationId
) -> Result<Weight, DispatchError>
fn can_revoke( &self, who: &AttesterId, ctype: &Ctype, credential_id: &CredentialId, authorization_id: &AuthorizationId ) -> Result<Weight, DispatchError>
Decides whether the account is allowed to revoke the credential with
the authorization_id
and the access information provided by the sender
(&self).
sourcefn can_unrevoke(
&self,
who: &AttesterId,
ctype: &Ctype,
credential_id: &CredentialId,
authorization_id: &AuthorizationId
) -> Result<Weight, DispatchError>
fn can_unrevoke( &self, who: &AttesterId, ctype: &Ctype, credential_id: &CredentialId, authorization_id: &AuthorizationId ) -> Result<Weight, DispatchError>
Decides whether the account is allowed to revoke the credential with
the authorization_id
and the access information provided by the sender
(&self).
sourcefn can_remove(
&self,
who: &AttesterId,
ctype: &Ctype,
credential_id: &CredentialId,
authorization_id: &AuthorizationId
) -> Result<Weight, DispatchError>
fn can_remove( &self, who: &AttesterId, ctype: &Ctype, credential_id: &CredentialId, authorization_id: &AuthorizationId ) -> Result<Weight, DispatchError>
Decides whether the account is allowed to remove the credential 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 credentials.
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_issue_weight(&self) -> Weight
fn can_issue_weight(&self) -> Weight
The worst-case weight of can_issue
.
sourcefn can_revoke_weight(&self) -> Weight
fn can_revoke_weight(&self) -> Weight
The worst-case weight of can_revoke
.
sourcefn can_unrevoke_weight(&self) -> Weight
fn can_unrevoke_weight(&self) -> Weight
The worst-case weight of can_unrevoke
.
sourcefn can_remove_weight(&self) -> Weight
fn can_remove_weight(&self) -> Weight
The worst-case weight of can_remove
.