|
|
@ -4,10 +4,10 @@ from flask_login import current_user |
|
|
|
def parse_permission(string): |
|
|
|
def parse_permission(string): |
|
|
|
""" |
|
|
|
""" |
|
|
|
Parsing permission string |
|
|
|
Parsing permission string |
|
|
|
permission_type{read,delete,write,update,*(for all permissions)}::module_name{module name or for all modules *}::union_id{for all companies *}/item_id{for all items *} |
|
|
|
permission_type{read,delete,write,update,*(for all permissions)}::module_name{module name or for all modules *}::union_id{for all unions *}/item_id{for all items *} |
|
|
|
example string: |
|
|
|
example string: |
|
|
|
read::collectors::union1id/* ->read union1 all collectors |
|
|
|
read::payments::union1id/* ->read union1 all payments |
|
|
|
read::collectors::union1id/collector1 ->read union1 collector1 |
|
|
|
read::payments::union1id/collector1 ->read union1 collector1 |
|
|
|
*::users::union2/* -> read, write, update, delete all users for union2 |
|
|
|
*::users::union2/* -> read, write, update, delete all users for union2 |
|
|
|
*::users::union2/user1 -> read, write, update, delete for users1 in union2 |
|
|
|
*::users::union2/user1 -> read, write, update, delete for users1 in union2 |
|
|
|
*::*::union2/* -> all permissions for union2 |
|
|
|
*::*::union2/* -> all permissions for union2 |
|
|
|