0001-agent-consider-allowed-technical-roles-when-provisio.patch
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 |
- |