forked from ScoDoc/ScoDoc
Update opolka/ScoDoc from ScoDoc/ScoDoc #2
@ -117,18 +117,6 @@ def check_access_diretud(formsemestre_id, required_permission=Permission.ScoImpl
|
|||||||
return True, ""
|
return True, ""
|
||||||
|
|
||||||
|
|
||||||
def can_change_groups(formsemestre_id: int) -> bool:
|
|
||||||
"""Vrai si l'utilisateur peut changer les groupes dans ce semestre
|
|
||||||
Obsolete: utiliser FormSemestre.can_change_groups
|
|
||||||
"""
|
|
||||||
formsemestre: FormSemestre = FormSemestre.query.get_or_404(formsemestre_id)
|
|
||||||
if not formsemestre.etat:
|
|
||||||
return False # semestre verrouillé
|
|
||||||
if current_user.has_permission(Permission.ScoEtudChangeGroups):
|
|
||||||
return True # typiquement admin, chef dept
|
|
||||||
return formsemestre.est_responsable(current_user)
|
|
||||||
|
|
||||||
|
|
||||||
def can_handle_passwd(user: User, allow_admindepts=False) -> bool:
|
def can_handle_passwd(user: User, allow_admindepts=False) -> bool:
|
||||||
"""True if the current user can see or change passwd info of user.
|
"""True if the current user can see or change passwd info of user.
|
||||||
If allow_admindepts, allow Admin from all depts (so they can view users from other depts
|
If allow_admindepts, allow Admin from all depts (so they can view users from other depts
|
||||||
|
Loading…
Reference in New Issue
Block a user