Flow_04t49zv
# Permission for each group
When you select continue, the following permissions will be written to the database.
{% for group in group_info %}
---
## Group: {{group['name']}}
**Users in Group:**
{% for user in group['users'] %}
* {{ user }}
{% endfor %}
**Permissions:**
| Path | Allowed Actions |
| ---------------| -------|
{% for permission in group['permissions'] %}
| {{permission['uri']}} | {{ permission['actions'] |join(', ') }} |
{% endfor %}
{% endfor %}
Flow_0f4klqg
Flow_0q5cs4y
Flow_0q5cs4y
Flow_132k5th
refresh_permissions(group_info)
# all_permissions = get_all_permissions()
# Permissions updated.
We previously displayed all permissions here, but it was darn near locking up my laptop.
# del(all_permissions)
Flow_132k5th
Flow_1ozuh1f
{
"groups": [
"Administrators"
],
"users": [
"admin@spiffworkflow.org"
],
"permission_groups": [
"Administrators"
],
"permission_uris": [
"/*"
],
"permissions": [
[
"create",
"read",
"update",
"delete"
]
]
}
{
"group_info": [
{
"name":"Administrators",
"permissions": [
{"actions": [
"create","read","update","delete"
],
"uri": "/*"
}
],
"users": ["admin@spiffworkflow.org"]
}
]
}
{
"groups": [
"Administrators",
"Everyone"
],
"users": [
"admin@spiffworkflow.org",
"*"
],
"permission_groups": [
"Administrators",
"Everyone"
],
"permission_uris": [
"/*",
"/*"
],
"permissions": [
[
"create",
"read",
"update",
"delete"
],
[
"read"
]
]
}
{
"group_info": [
{
"name": "Administrators",
"permissions": [
{
"actions": [
"create",
"read",
"update",
"delete"
],
"uri": "/*"
}
],
"users": [
"admin@spiffworkflow.org"
]
},
{
"name": "Everyone",
"permissions": [
{
"actions": [
"read"
],
"uri": "/*"
}
],
"users": [
"*"
]
}
]
}
Flow_0ac1ww6
Flow_0f4klqg
info_by_group = {}
for i, group in enumerate(groups):
if not group in info_by_group:
info_by_group[group] = {"users":[], "permissions": []}
info_by_group[group]["users"].append(users[i])
for i, group in enumerate(permission_groups):
if not group in info_by_group:
info_by_group[group] = {"users":[], "permissions": []}
info_by_group[group]["permissions"].append(
{"uri": permission_uris[i],
"actions": permissions[i]}
)
group_info = []
for group in info_by_group.keys():
group_info.append({
"name": group,
"users": info_by_group[group]['users'],
"permissions": info_by_group[group]['permissions']
})
del(info_by_group)
del(group)
del(i)
del(groups)
del(permissions)
del(permission_groups)
del(permission_uris)
del(users)
Flow_1ozuh1f
users_to_groups_dev
Flow_04t49zv
Flow_0ba4jrh
groups_to_permissions_dev
Flow_0ba4jrh
Flow_0ac1ww6