Projet

Général

Profil

0001-agent-consider-allowed-technical-roles-when-provisio.patch

Frédéric Péters, 15 octobre 2019 13:57

Télécharger (1,24 ko)

Voir les différences:

Subject: [PATCH] agent: consider allowed technical roles when provisionning
 roles (#36937)

 hobo/agent/authentic2/provisionning.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
hobo/agent/authentic2/provisionning.py
213 213
            })
214 214

  
215 215
    def notify_roles(self, ous, roles, mode='provision', full=False):
216
        roles = set([role for role in roles if not role.slug.startswith('_')])
216
        allowed_technical_roles_prefixes = getattr(settings, 'HOBO_PROVISION_ROLE_PREFIXES', []) or []
217

  
218
        def is_forbidden_technical_role(role):
219
            return role.slug.startswith('_') and not role.slug.startswith(tuple(allowed_technical_roles_prefixes))
220

  
221
        roles = set([role for role in roles if not is_forbidden_technical_role(role)])
217 222
        if mode == 'provision':
218 223
            self.complete_roles(roles)
219 224

  
220
-