current_user & current_administrator

31 views
Skip to first unread message

Misha Slyusarev

unread,
Feb 10, 2014, 9:24:26 AM2/10/14
to declarative_...@googlegroups.com
Hi. What if I got two models (user and administrator) for which I'd like to have different roles. It's easy to get the gem work for User model, but how can I setup Administrator to work simultaneously with User and have it's own roles?

Sue Petersen

unread,
Feb 10, 2014, 5:04:08 PM2/10/14
to declarative_...@googlegroups.com
Is there some reason why Administrator is a separate model? I've always
seen Administrator as a special, privileged User?
> --
> You received this message because you are subscribed to the Google
> Groups "declarative_authorization" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to declarative_author...@googlegroups.com.
> To post to this group, send email to
> declarative_...@googlegroups.com.
> Visit this group at
> http://groups.google.com/group/declarative_authorization.
> For more options, visit https://groups.google.com/groups/opt_out.


--
--
SueP
http://www.cowgirlcoder.com

Misha Slyusarev

unread,
Feb 12, 2014, 3:39:48 AM2/12/14
to declarative_...@googlegroups.com
I'd like to have it as a separate model to keep information that a regular user wouldn't have. And to have different references with other models. And one more thing. I'd like users to have roles and administrators to have permissions, that is, each user will act only within the limits of its role (author, company, etc), but administrators could have different permissions (moderate, create new user, etc) which may change over time.

Cancan have the ability to change default settings according to situation https://github.com/ryanb/cancan/wiki/Changing-Defaults
Is something like that possible with declarative_authorization? Or maybe any other ideas?
Reply all
Reply to author
Forward
0 new messages