You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ends up with not very descriptive permissions names e.g. auth | user |. The lack of name leaves the last value of the string representation of the object blank.
It would be a nice enhancement to have the ability to "Capital Case And Space" the permission_name assigned to the codename value in the Permissions object instance.
This would in turn allow for the following example permission description: auth | user | Can Edit Role
I don't have time at the moment to submit a PR that would facilitate this transformation. I am also unsure how to make this change backwards compatible with the Permissions.object.get_or_create method.
The text was updated successfully, but these errors were encountered:
Hi @avelis, this does makes sense. I not sure how we would be able to do this. I imagine there could be some mapping in the Role to specify this. Something like:
class RolRole1(AbstractUserRole):
available_permissions = {
'permission1': {
'default': True,
'label': 'The permission 1'
},
'permission2': {
'default': False,
'label': 'Other name for the permission 2'
}
}
My solution (like in my mind only) was to transform the dictionary key string into a readable name value. Since camelToSnake is in this library, I had thoughts of making a "capticalCaseAndSpace" method that would perform the transformation of a dictionary key values. (e.g. capticalCaseAndSpace("manage_tickets") would return "Manage Tickets".
With that said, I your solution works just fine. 👍
The following line:
Ends up with not very descriptive permissions names e.g.
auth | user |
. The lack of name leaves the last value of the string representation of the object blank.It would be a nice enhancement to have the ability to "Capital Case And Space" the
permission_name
assigned to thecodename
value in the Permissions object instance.This would in turn allow for the following example permission description:
auth | user | Can Edit Role
I don't have time at the moment to submit a PR that would facilitate this transformation. I am also unsure how to make this change backwards compatible with the
Permissions.object.get_or_create
method.The text was updated successfully, but these errors were encountered: