MCPcopy Create free account
hub / github.com/StackStorm/st2 / validate

Method validate

st2common/st2common/models/api/rbac.py:223–234  ·  view source on GitHub ↗
(self, validate_role_exists=False)

Source from the content-addressed store, hash-verified

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
237class UserRoleAssignmentFileFormatAPI(BaseAPI):

Callers 3

validateMethod · 0.45
validateMethod · 0.45
validateMethod · 0.45

Calls 3

get_rbac_backendFunction · 0.90
get_service_classMethod · 0.45
validate_roles_existsMethod · 0.45

Tested by

no test coverage detected