Projet

Général

Profil

Bug #8558

Change to the admin roles permissions are not applied

Ajouté par Benjamin Dauvergne il y a plus de 8 ans. Mis à jour il y a plus de 6 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Catégorie:
-
Version cible:
Début:
08 octobre 2015
Echéance:
% réalisé:

100%

Temps estimé:
Patch proposed:
Non
Planning:

Description

This code in update_ous_admin_roles() prevents update_ou_admin role to be called for all ou:

    ou_ids = ou_all.values_list('id', flat=True)
...
    perm_ids_with_role = Role.objects.filter(
        admin_scope_ct=ContentType.objects.get_for_model(Permission)
        ).values_list('admin_scope_id')
    ou_admin_perms = Permission.objects.filter(
        operation__slug='view',
        target_ct=ContentType.objects.get_for_model(OU), id__in=perm_ids_with_role)
    ou_ids_with_perm = ou_admin_perms.values_list('target_id', flat=True)
...
    for ou in OU.objects.filter(id__in=set(ou_ids)-set(ou_ids_with_perm)):
        update_ou_admin_roles(ou)

But it prevents too much.


Demandes liées

Lié à Authentic 2 - Bug #8565: NameError: global name 'ou_admin_perms' is not definedFermé08 octobre 2015

Actions

Révisions associées

Révision a058c274 (diff)
Ajouté par Benjamin Dauvergne il y a plus de 8 ans

a2_rbac/management: remove broken optimization in update_ous_admin_roles (fixes #8558)

Trying to filter ou before updating their admin roles fails because the
filtering is too simple, so we lack some chanes, for example adding the
vire permission on organizational unit to all admin roles.

Révision 55c57090 (diff)
Ajouté par Benjamin Dauvergne il y a plus de 8 ans

a2_rbac: fix undefined variables errors (fixes #8558)

Also some pep8 enhancements.

Historique

#2

Mis à jour par Benjamin Dauvergne il y a plus de 8 ans

  • Statut changé de Nouveau à Résolu (à déployer)
  • % réalisé changé de 0 à 100
#3

Mis à jour par Frédéric Péters il y a plus de 8 ans

  • Lié à Bug #8565: NameError: global name 'ou_admin_perms' is not defined ajouté
#5

Mis à jour par Benjamin Dauvergne il y a environ 8 ans

  • Statut changé de Résolu (à déployer) à Solution déployée
#7

Mis à jour par Benjamin Dauvergne il y a plus de 6 ans

  • Statut changé de Solution déployée à Fermé

Formats disponibles : Atom PDF