PerlDancer / PerlDancer/Dancer2-Plugin-Auth-Extensible

More Tools for handling roles

Open
#49 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Perl
Stars
10
Forks
21
PR merge metrics
No merged PRs in 30d

Description

I'm just starting my dive into Dancer, and for my lab's purposes, I'm seeing a heavy use of roles. I'm happy to see things like require_role and require_any_role, and user_has_role and _user_roles _ will be very useful as well.

But I'm wanting to have the tools for handing account creation within the app, and while update_user seems to have most of the data points of a user handled, I am not seeing and cannot think through how to add a user role without rolling my own insert, and that sort of thing is what we're using DBIx::Class to avoid, isn't it?

So, I would like, along with user_has_role and user_roles, add_user_role and remove_user_role, hopefully working something like:

add_user_role 'bofh' , 'admin' ;
remove_user_role 'pfy' , 'helpdesk' ;

I am using the suggested users, roles, and user_roles tables.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing user_has_role, user_roles, and update_user entry points and how they use the suggested users, roles, and user_roles tables through DBIx::Class. Define the behavior of add_user_role and remove_user_role for the example username and role arguments, then verify that users can gain and lose roles without a handwritten insert.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl
Domain
authentication
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.