Project

usman

0.0
No commit activity in last 3 years
No release in over 3 years
Usman gives you a user module with Admin Interface to Manage Features, Users and their permissions.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 2.4.3, ~> 2.4
>= 1.1.0, ~> 1.1
>= 1.3.0, ~> 1.4
>= 4.4.0, ~> 4.8
>= 4.8.0, ~> 4.8
~> 0.4.4
>= 0.10.0, ~> 0.10

Runtime

>= 1.1.0, ~> 1.1
~> 3.0
~> 0.8
~> 0.1.1
>= 4.2.2, ~> 4.2
>= 1.0.1, ~> 1.0
>= 0.1.39, ~> 0.1
>= 0.1.25, ~> 0.1
>= 5.0.2, ~> 5.0
 Project Readme

Usman

Simple User & Feature Permission Management with APIs.

Usman is a mountable plugin and it requires another full pluggin named kuppayam to run. Kuppayam offers usman the UI skin with basic modules for running like Polymorphic Image and Document Models etc.

Installation

Add this line to your application's Gemfile:

gem 'usman'

And then execute:

$ bundle

Or install it yourself as:

$ gem install usman

Usage

Installing the kuppayam & usman migrations

Usman uses kuppayam skins and hence it requires the basic migrations from kuppayam to run Run the below command to copy the migrations from the kuppayam engine.

$ bundle exec rake railties:install:migrations

This will copy migrations from kuppayam and usman engines which will have migrations to create images, documents, users, features and permissions respectively.

Mount the engine

Mount usman engine in your application routes.rb

mount Usman::Engine => "/"

open browser and go to /sign_in url

Railties order

Specify the railties order if required in main application.rb

config.autoload_paths << "app/services"
config.railties_order = [:main_app, Usman::Engine, Kuppayam::Engine, :all]

Seeding / Importing Data

run rake task for loading dummy data for users and features to start with.

$ bundle exec rake usman:import:dummy:all verbose=false

["users", "features", "permissions", "roles"]

You could also do it individually but the above command will run in the following order - users, features, permissions, roles. This order is important as features need users to be imported first.

$ bundle exec rake usman:import:dummy:users verbose=false
$ bundle exec rake usman:import:dummy:features verbose=false
$ bundle exec rake usman:import:dummy:permissions verbose=false
$ bundle exec rake usman:import:dummy:roles verbose=false

Cusotmized Importing

You could override the seed files with your data. just create db/import_data in your project folder and create the following files filled with your data in the required format (checkout the dummy csvs in usman db/import_data/dummy/features.csv) for the columns required

for e.g:

create users.csv in db/import_data/ foler and fill data in it and run

$ bundle exec rake usman:import:users verbose=false

Testing the gem

cd spec/dummy rails db:create db:migrate

rails s -p

Running rspec

rails db:create db:migrate RAILS_ENV

run rspec from the rails root folder and not from dummy folder as spec helper has been linked to dummy.

rspec

Contributing

Visit - https://github.com/right-solutions/usman Feel free to submit a patch

License

The gem is available as open source under the terms of the MIT License.