Correctifs sur les adhésions glissantes.

This commit is contained in:
Pierre-Elliott Bécue 2014-08-25 19:17:10 +02:00
parent 7f1ffbeed5
commit 50f91c63e0
4 changed files with 32 additions and 27 deletions

View file

@ -90,7 +90,7 @@ soi = u"soi"
respo = u"responsable"
#: Liste de tous les droits
TOUS_DROITS = [nounou, apprenti, bureau, tresorier, imprimeur, moderateur, multimachines, cableur, webmaster]
TOUS_DROITS = [nounou, apprenti, bureau, tresorier, imprimeur, moderateur, multimachines, cableur, webmaster, webradio]
#: Liste des droits forts
DROITS_ELEVES = [nounou, bureau, tresorier]
#: Liste des droits intérmédiaires
@ -588,6 +588,12 @@ class generalizedTimeFormat(Attr):
resource = generalizedTimeFormat(othertime, conn=None, Parent=None)
return self._stamp < resource._stamp
def __le__(self, othertime):
return not (self > othertime)
def __ge__(self, othertime):
return not (self < othertime)
def __gt__(self, othertime):
return not (self < othertime) and not (self == othertime)
@ -1337,18 +1343,10 @@ class homeDirectory(Attr):
modifiables = list(modifiables)
for droit in self.parent.get('droits', []):
if droit not in modifiables:
if droit not in modifiables and droit in TOUS_DROITS:
return False
return super(homeDirectory, self).is_modifiable(liste_droits)
def parse_value(self, home):
uid = unicode(self.parent['uid'][0])
if uid.startswith(u'club-'):
uid = uid.split('-', 1)[1]
if home != u'/home/%s' % uid and home != u'/home/club/%s' % uid:
raise ValueError("Le répertoire personnel n'est pas bon: %r (devrait être %r ou %r)" % (home, '/home/%s' % self.parent['uid'][0], '/home/club/%s' % self.parent['uid'][0]))
self.value = home
@crans_attribute
class loginShell(Attr):
singlevalue = True
@ -1539,6 +1537,7 @@ class modePaiement(Attr):
category = 'factures'
optional = False
singlevalue = True
can_modify = [cableur, nounou]
ldap_name = "modePaiement"
def parse_value(self, mode):
@ -1549,6 +1548,7 @@ class modePaiement(Attr):
@crans_attribute
class recuPaiement(Attr):
ldap_name = "recuPaiement"
can_modify = [cableur, nounou]
@crans_attribute
class article(Attr):