Commit 7f399206 authored by Ivar Derksen's avatar Ivar Derksen Committed by David Venhoek
Browse files

Added support for DisallowDelete

parent 2a599d69
......@@ -62,6 +62,7 @@ type CredentialType struct {
IssuerID string `xml:"IssuerID"`
SchemeManagerID string `xml:"SchemeManager"`
IsSingleton bool `xml:"ShouldBeSingleton"`
DisallowDelete bool `xml:"DisallowDelete"`
Description TranslatedString
AttributeTypes []*AttributeType `xml:"Attributes>Attribute" json:"-"`
XMLVersion int `xml:"version,attr"`
......
......@@ -297,8 +297,11 @@ func (client *Client) remove(id irma.CredentialTypeIdentifier, index int, storen
return nil
}
// RemoveCredential removes the specified credential.
// RemoveCredential removes the specified credential if that is allowed.
func (client *Client) RemoveCredential(id irma.CredentialTypeIdentifier, index int) error {
if client.Configuration.CredentialTypes[id].DisallowDelete {
return errors.Errorf("configuration does not allow removal of credential type %s", id.String())
}
return client.remove(id, index, true)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment