Skip to content

Commit

Permalink
add basic permissions to default_roles.json #86
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed Jul 26, 2020
1 parent 3c1c720 commit 510489c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
28 changes: 21 additions & 7 deletions priv/repo/default_roles.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,50 @@
{
"name": "superadmin",
"desc": "With great power comes great responsibility",
"person_id": "1"
"person_id": "1",
"id": "1",
"permissions": "grant_admin_role"
},
{
"name": "admin",
"desc": "Can perform all system administration tasks",
"person_id": "1"
"person_id": "1",
"id": "2",
"permissions": "manage_people, grant_non_admin_role"
},
{
"name": "moderator",
"desc": "Can view and neutrally moderate any content. Can ban rule-breakers. Cannot delete.",
"person_id": "1"
"person_id": "1",
"id": "3",
"permissions": "edit_any_content, lock_content, ban_rule_breaking_people, view_deleted"
},
{
"name": "creator",
"desc": "Can create any content. Can edit and delete their own content.",
"person_id": "1"
"person_id": "1",
"id": "4",
"permissions": "create_content, edit_own_content, delete_own_content"
},
{
"name": "commenter",
"desc": "Can comment on content where commenting is available.",
"person_id": "1"
"person_id": "1",
"id": "5",
"permissions": "comment"
},
{
"name": "subscriber",
"desc": "Subscribes for updates e.g. newsletter or content from a specific person. Cannot comment until verified.",
"person_id": "1"
"person_id": "1",
"id": "6",
"permissions": "subscribe, give_feedback"
},
{
"name": "banned",
"desc": "Can still login to see their content but cannot perform any other action.",
"person_id": "1"
"person_id": "1",
"id": "7",
"permissions": "view_content, view_profile, delete_own_content, delete_own_profile"
}
]
2 changes: 2 additions & 0 deletions priv/repo/seeds.exs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ defmodule SetupRoles do
Role.create_role(role)
end)
end


end

SetupRoles.create_default_roles()

0 comments on commit 510489c

Please sign in to comment.