-
CanCan constructs sql like so
```
... where cond0 OR (
cond1 OR (
cond2 ...
)
)
```
this useless deep nesting on sqlite3 results in a Parser Stack Overflow error.
A better SQL would be:
``…
clyfe updated
10 years ago
-
- Create a namespace /backend, which require and allow admin user only to log in
- First we need a way for admin to manage mails format which will be sent to users
-
> 用户添加角色
用户可以同时拥有多种身份
角色分别有:
- admin
- event_organzer
- tutor
- student
-
-
In ability.rb I have:
``` ruby
user ||= user.new # guest user
if user.id == 1 #quick hack
can :access, :all
elsif
can :read, :domains, [:name, :entries], :user_id => user.id
…
-
Just a heads up, I've spent a few hours trying to workout why two model checks with can? were returning true, despite only one was set for the user. Take the following as an example:
``` ruby
class S…
-
now I have:
```
can :read, Person, officer_id: user.id
can :read, Person, co_officer_id: user.id
```
is it possible to do it on one line? like
```
can :read, Person, [{officer_id: user.id}, {co_off…
-
hello,
Is possible split my CanCan 2.0 Ability similar RailsCast episode 386?
```
if user.nil?
GuestPermission.new
elsif user.admin?
AdminPermission.new(user)
else
Membe…
-
In CanCan 2.0, it appears that submitting a datetime or time from a datetime_select or time_select form helper throws an Unauthorized error after authorizing a datetime attribute in a resource. I'm as…
azuby updated
10 years ago
-
### Steps to reproduce
In the scenario where the current user has the ability to only edit/update certain attributes on a user model. If the current user has the "admin" role and @user has a role o…