wesdelp / personas Goto Github PK
View Code? Open in Web Editor NEWMulti user role based app support for Rails using Devise
License: MIT License
Multi user role based app support for Rails using Devise
License: MIT License
We're currently putting custom persona files into app/models/persona
although maybe we should be putting them into app/models/personas
instead.
Since we allow users to create their own personas, we'll want to make sure to sanitize the names they provide. Consider checking for special characters, spaces, punctuation marks, non-unicode characters, etc.
Potential workflow is to simply reject these names with a message to the user warning them why the name is invalid.
I've ran into it myself where the gem didn't seem to be working and it was because I forgot to run the install generator and the personas initializer wasn't in my app. Let's add a helpful FAQ section for the questions we see most often.
Potential questions:
We'll want a workflow developers can follow when making contributions to the gem (such as making a PR and tagging someone)
We should have descriptions for the multiple generators in both the files themselves and more importantly the README.
Descriptions should include:
The .rubocop.yml
file got lost in the migration from CMM's GitHub to public GitHub. Gonna need that or we'll be forever at the whim of default Rubocop configs (shudder)
We'll want a description of the gem and why someone would use it. Consider adding pros and cons, who should use it vs who shouldn't, etc.
Travis-CI supports cron jobs that let us test the master branch every day and email us if it doesn't succeed.
Running
rails g personas:create Admin
should inject the route helper into config/routes.rb
like so
include Personas::PersonaRouter
Rails.application.routes.draw do
for_persona :admin do
root to: 'dashboard#index'
resources :persona_switches, only: :create
end
end
Users will need a quick start guide in the README with instructions on how to actually use the gem once they have installed it.
At a minimum it should have the following:
rails g personas:install
generatorrails g personas:create
generatorSince there will still be a bit of custom setup on the user's end, we should create an example application that people can refer to see the optimal way of setting the gem up.
We should include a link somewhere in the README so people know where to find it as well.
We should consider adding SimpleCov or some other code coverage tool to be sure we don't have any large gaps in our spec coverage moving forward.
Include it in the controller module, and check set_persona to handle the masquerade appropriately.
The persona switcher is a useful part of the gem, we should consider creating a view helper for users to drop into their application to easily pull in a select form. Options we should consider adding are styles, available options, include_blank. We can add more as we come up with ideas.
We'll want a CI instance in order to keep us from breaking something. Be sure to create a script or something that it runs to be sure we can version track our job script.
In the template we use for the initializer we should check that Warden/Devise is installed so we can log a more helpful error when the middleware we add inevitably blows up.
#1 added RSpec to our project, we should go ahead and continuing building out our spec coverage.
This one's pretty straightforward.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.