(self, validate_role_exists=False)
| 221 | """ |
| 222 | |
| 223 | def validate(self, validate_role_exists=False): |
| 224 | # Parent JSON schema validation |
| 225 | cleaned = super(BaseRoleAssigmentAPI, self).validate() |
| 226 | |
| 227 | # Custom validation |
| 228 | if validate_role_exists: |
| 229 | # Validate that the referenced roles exist in the db |
| 230 | rbac_service = get_rbac_backend().get_service_class() |
| 231 | # pylint: disable=no-member |
| 232 | rbac_service.validate_roles_exists(role_names=self.roles) |
| 233 | # pylint: enable=no-member |
| 234 | return cleaned |
| 235 | |
| 236 | |
| 237 | class UserRoleAssignmentFileFormatAPI(BaseAPI): |
no test coverage detected