[attributs, objets] Affinage des permissions sur les certificats
This commit is contained in:
parent
f5347106c7
commit
fefad357fc
3 changed files with 21 additions and 7 deletions
11
objets.py
11
objets.py
|
@ -1124,9 +1124,9 @@ class facture(CransLdapObject):
|
|||
|
||||
@crans_object
|
||||
class baseCert(CransLdapObject):
|
||||
can_be_by = { variables.created: [attributs.nounou, attributs.bureau],
|
||||
variables.modified: [attributs.nounou, attributs.bureau],
|
||||
variables.deleted: [attributs.nounou, attributs.bureau],
|
||||
can_be_by = { variables.created: [attributs.nounou, attributs.bureau, attributs.parent],
|
||||
variables.modified: [attributs.nounou, attributs.bureau, attributs.parent],
|
||||
variables.deleted: [attributs.nounou, attributs.bureau, attributs.parent],
|
||||
}
|
||||
attribs = [ attributs.xid, attributs.certificat, attributs.hostCert, attributs.historique]
|
||||
|
||||
|
@ -1202,10 +1202,11 @@ class baseCert(CransLdapObject):
|
|||
def delete(self, comm="", login=None):
|
||||
"""Supprimme l'objet de la base LDAP."""
|
||||
if u"x509Cert" in self['objectClass']:
|
||||
if not self['revocked'] or not self['revocked'][0]:
|
||||
# Si le certificat est encore valide et qu'il n'a pas été révoqué
|
||||
if self['end'] > int(time.time()) and (not self['revocked'] or not self['revocked'][0]):
|
||||
for issuer in self['issuerCN']:
|
||||
if issuer in self.protected_issuer:
|
||||
raise EnvironmentError("Vous n'avez pas le droit de supprimer %s tant que le certificat n'aura pas été marqué comme révoqué" % self.dn)
|
||||
raise EnvironmentError("Vous n'avez pas le droit de supprimer %s tant que le certificat n'aura pas expiré ou été marqué comme révoqué" % self.dn)
|
||||
super(baseCert, self).delete(comm, login)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue