From 510489c581fd621ec45d4af1d20336556689694c Mon Sep 17 00:00:00 2001 From: nelsonic Date: Sun, 26 Jul 2020 09:46:44 +0100 Subject: [PATCH] add basic permissions to default_roles.json #86 --- priv/repo/default_roles.json | 28 +++++++++++++++++++++------- priv/repo/seeds.exs | 2 ++ 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/priv/repo/default_roles.json b/priv/repo/default_roles.json index 71d36bd4..e5f3b8ad 100644 --- a/priv/repo/default_roles.json +++ b/priv/repo/default_roles.json @@ -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" } ] \ No newline at end of file diff --git a/priv/repo/seeds.exs b/priv/repo/seeds.exs index c71744b0..72259d8d 100644 --- a/priv/repo/seeds.exs +++ b/priv/repo/seeds.exs @@ -107,6 +107,8 @@ defmodule SetupRoles do Role.create_role(role) end) end + + end SetupRoles.create_default_roles() \ No newline at end of file