diff --git a/lib/auth/app.ex b/lib/auth/app.ex index 2ae3e02d..17b7ca92 100644 --- a/lib/auth/app.ex +++ b/lib/auth/app.ex @@ -42,7 +42,7 @@ defmodule Auth.App do end # Returning all apps when person_id == 1 (superadmin) means - # the superadmin can always see/manage all apps as necessary. + #  the superadmin can always see/manage all apps as necessary. # Later we could refactor this function to use RBAC.has_role_any/2. def list_apps(conn) when is_map(conn) do case conn.assigns.person.id == 1 do @@ -57,7 +57,6 @@ defmodule Auth.App do |> Repo.all() end - @doc """ Gets a single app. diff --git a/lib/auth_web/controllers/role_controller.ex b/lib/auth_web/controllers/role_controller.ex index 998e3db3..fc5cfe5b 100644 --- a/lib/auth_web/controllers/role_controller.ex +++ b/lib/auth_web/controllers/role_controller.ex @@ -103,11 +103,13 @@ defmodule AuthWeb.RoleController do end # https://elixirforum.com/t/map-key-is-a-atom-or-string/13285/2 - # our use-case for this is specific keys in controller params + #  our use-case for this is specific keys in controller params # mix gen creates tests with atom keys whereas controller expect string keys! defp map_get(map, string_key, default \\ 0) do - to_string(Map.get(map, string_key) || - Map.get(map, String.to_atom(string_key), default)) + to_string( + Map.get(map, string_key) || + Map.get(map, String.to_atom(string_key), default) + ) end defp person_owns_app?(apps, app_id) do