Permission field validation in Create Group API #115
Labels
available
No one has claimed the issue (or) is working on it.
enhancement
New feature or request
good first issue
Good for newcomers
Is your feature request related to a problem? Please describe.
A field level validation for permission_array field in
[post] /api/org/(org-id)/group/
API instead of using theCreateGroupSerializer.permissions_valid()
. As asked in comment in #110The function below has to be replaced and can be used as a reference:
Describe the solution you'd like
Instead of using
CreateGroupSerializer.permissions_valid()
, use Field-level validation to letserializer.is_valid()
do the validation ofpermission_array
.Describe alternatives you've considered
Use the
Permissions.set_permissions()
ofcustom_model_field.py
to validate the permission ints in thepermission_array
using try except else statement. Catch the PERMISSION_INT_INVALID exception in the except clause.Additional context
The reference for the solution can be Field-level validation
The text was updated successfully, but these errors were encountered: