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

Add :app_id to people_roles + allow people to grant any role for their app(s) #119

Closed
3 tasks done
nelsonic opened this issue Sep 16, 2020 · 2 comments
Closed
3 tasks done
Assignees
Labels
chore a tedious but necessary task often paying technical debt enhancement New feature or enhancement of existing functionality in-progress An issue or pull request that is being worked on by the assigned person priority-2 Second highest priority, should be worked on as soon as the Priority-1 issues are finished T1h Time Estimate 1 Hour technical A technical issue that requires understanding of the code, infrastructure or dependencies

Comments

@nelsonic
Copy link
Member

nelsonic commented Sep 16, 2020

At present only superadmin (person.id == 1) can grant roles to people.

def grant(conn, params) do
# confirm that the granter is either superadmin (conn.assigns.person.id == 1)
# or has an "admin" role (1 || 2)
granter_id = conn.assigns.person.id
# we need to expand grant priviledges see: https://github.com/dwyl/auth/issues/119
if granter_id == 1 do
role_id = map_get(params, "role_id")
person_id = map_get(params, "person_id")
Auth.PeopleRoles.insert(granter_id, person_id, role_id)
redirect(conn, to: Routes.people_path(conn, :show, person_id))
else
AuthWeb.AuthController.unauthorized(conn)
end
end

We obviously need the ability for people who own an app to be able to grant the role that they created to any person who has authenticated with their app ...

Todo

  • Add :app_id to people_roles schema.
  • Restrict granting a role to the person that owns the App.
    • Any person should be able to grant one of the default roles to any person authenticated with their App (via auth).

This is related to (but distinct from) restricting access to roles #116

@nelsonic nelsonic added enhancement New feature or enhancement of existing functionality priority-2 Second highest priority, should be worked on as soon as the Priority-1 issues are finished chore a tedious but necessary task often paying technical debt T25m Time Estimate 25 Minutes technical A technical issue that requires understanding of the code, infrastructure or dependencies labels Sep 16, 2020
@nelsonic
Copy link
Member Author

I still have my editor open for #85 so I'm going to make a quick pass at this now. Wish me luck! 💭

@nelsonic
Copy link
Member Author

This issue is complete but will only be enabled once #123 is merged. :shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore a tedious but necessary task often paying technical debt enhancement New feature or enhancement of existing functionality in-progress An issue or pull request that is being worked on by the assigned person priority-2 Second highest priority, should be worked on as soon as the Priority-1 issues are finished T1h Time Estimate 1 Hour technical A technical issue that requires understanding of the code, infrastructure or dependencies
Projects
None yet
Development

No branches or pull requests

1 participant