I want to configure the devise gem for admin user. In my application ive installed the devise gem and currently it is used as a normal user who has account in my application. I want to add administration in my application so that an admin user can delete or modify etc operations to a particular user account and also do other administrative work such as deleting the user data which is not appropriate for public users.
I'd look into two gems: RailsAdmin and CanCan.
Related
If a web application just needs to authenticate users with a google account with omniauth, in other words, users can just login with their google account.
What's the best choice to choose between the two gems:
omniauth-google-oauth2 or google-api-ruby-client ?
omniauth-google-oauth2 is your best choice, because "omniauth" gem not dependent on suppliers and perfectly integrates with Devise
I am experiencing some problems setting permissions on my Rails 3 web application. I currently use Devise and CanCan. I have a single User model, used by Devise. The roles are admin, manager and user.
My solution uses namespaces to separate administration panels.
Root (frontend)
- static pages
Manager
- administration pages for "manager" roled users.
Backend
- administration pages for "admin" roled users.
I read documentation and some tutorials but I can make it working. My problem is that CanCan checks ability with the action that the user is trying to execute on models.
So, if a user is logged as manager and has to manage his own Posts, he can do it by going on /manager/posts. But the problem is that he also can go to /backend/posts directory and can index Posts which he is not owner.
This problem happens because ability class tells that managers can index the Post model, but managers and admins, both are working on the Post model.
Is there a way to specify the namespace where the user is allowed to access, or not?
I saw there is many ways like using namespaced models (Backend::Posts Manager::Posts, using different tables)...
What is the best solution to manage permissions on a namespaced app where roles are working on same models, with Devise and CanCan?
Problem solved with this solution:
https://github.com/ryanb/cancan/wiki/Authorization-for-Namespaced-Controllers
I am writing a new authorization system and permission system for my multi tenant rails 3 app.
I need to have guests, basic users, site owners, site owners can have users, multi site owners with users and also admin users.
I am wondering what everyone would use for this setup ?
Devise, Authlogic, Sorcery etc ?
Canacan, declarative_authorization etc ?
or any other gems that would fit better for this sort of system.
thanks a lot
Rick
I personally prefer devise with cancan. I have yet to find anything that I was not able to do with that combination.
The question for those, who had worked with Active Admin gem:
I just don't get how should I make a sign up and change password functions for admin users? Can I do this using Active Admin interface?
Thanks in advance.
If you follow the install steps on the active admin github page, one of the steps installs devise for you, creates and admin_user table in your DB and populates it with a default user for you to login as.
See at GitHub.
In my Rails app I use Devise as the authentication system. I have successfully installed the Devide gem and its working fine.
But now I want to redirect user to a different path after they login, ex:
dash_board#home
How can I define that in Devise? I'm confused as it doesn't have any controllers shows (as sessions, users etc..). I can see them in the gem file, but I guess changing the gem is not a good option
I'm using Rails 3, Devise 1.1.3