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§

source

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).

source

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).

source

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).

source

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).

source

fn authorization_id(&self) -> AuthorizationId

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().

source

fn can_issue_weight(&self) -> Weight

The worst-case weight of can_issue.

source

fn can_revoke_weight(&self) -> Weight

The worst-case weight of can_revoke.

source

fn can_unrevoke_weight(&self) -> Weight

The worst-case weight of can_unrevoke.

source

fn can_remove_weight(&self) -> Weight

The worst-case weight of can_remove.

Implementations on Foreign Types§

source§

impl<AttesterId, AuthorizationId, Ctype, CredentialId> AccessControl<AttesterId, AuthorizationId, Ctype, CredentialId> for ()where AuthorizationId: Default,

source§

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

source§

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

source§

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

source§

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

source§

fn authorization_id(&self) -> AuthorizationId

source§

fn can_issue_weight(&self) -> Weight

source§

fn can_revoke_weight(&self) -> Weight

source§

fn can_unrevoke_weight(&self) -> Weight

source§

fn can_remove_weight(&self) -> Weight

Implementors§

source§

impl<T> AccessControl<<T as Config>::AttesterId, <T as Config>::AuthorizationId, <T as Config>::Hash, <<T as Config>::CredentialHash as Hash>::Output> for MockAccessControl<T>where T: Config<AuthorizationId = <T as Config>::AttesterId>,