Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ma/add read only group #163

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/oc_erchef/apps/oc_chef_authz/src/oc_chef_authz_org_creator.erl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
groups, nodes, roles, sandboxes, policies, policy_groups,
cookbook_artifacts]).

-define(GROUPS, [admins, 'billing-admins', clients, users]).
-define(GROUPS, [admins, 'billing-admins', clients, users, 'read-only-users']).

-define(ALL_PERMS, [create, read, update, delete, grant]).

Expand Down Expand Up @@ -85,7 +85,7 @@

%% Admins
{add_acl,
[mk_tl(container, ?CONTAINERS), mk_tl(group, [admins, clients, users]), {organization}],
[mk_tl(container, ?CONTAINERS), mk_tl(group, [admins, clients, users, 'read-only-users']), {organization}],
?ALL_PERMS, [{group, admins}]},

%% users
Expand All @@ -96,14 +96,22 @@
{add_acl, [mk_tl(container, [groups, containers]), {organization}], [read], [{group, users}]},
{add_acl, [{container, sandboxes}], [create], [{group, users}]},

%% read only users
{add_acl,
[mk_tl(container, [cookbooks, data, nodes, roles, environments, policies, cookbook_artifacts, clients, groups, containers])],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need policy_groups here as well?

[read], [{group, 'read-only-users'}]},
{add_acl, [{organization}], [read], [{group, 'read-only-users'}]},

%% clients

{add_acl, [{container, nodes}], [read, create], [{group, clients}]},
{add_acl, [{container, policies}], [read], [{group, clients}]},
{add_acl, [{container, policy_groups}], [read], [{group, clients}]},
{add_acl, [{container, cookbook_artifacts}], [read], [{group, clients}]},
{add_acl, [{container, data}], [read], [{group, clients}]},
{add_acl, mk_tl(container, [cookbooks, environments, roles]), [read] , [{group, clients}]}
{add_acl, mk_tl(container, [cookbooks, environments, roles]), [read] , [{group, clients}]},
{add_acl, [{container, policies}], [read], [{group, clients}]},
{add_acl, [{container, cookbook_artifacts}], [read], [{group, clients}]}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused by this bit. Doesn't this duplicate the lines above (where line 108==113 and line 110==114)?

]
}
]).
Expand Down