I am making an app that started with Rails Composer, Devise, CanCan, Twitter Bootstrap.

I know how to set the users permissions using the ability model. How do I add more roles to attribute certain permissions to?

有帮助吗?

解决方案

I was unable to find any help during my search, so here is what I came up with on my own.

Somewhere between rolify and rails composer, a Role table is made.

  1. Enter the rails console

    $ rails c
    
  2. Add your new role

    irb> Role.create name: 'new-role'
    

*Use this to display all of your roles

    irb> Role.all

*To Delete Roles

    irb> Role.delete(role_id)
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top