ryanb / cancan

Authorization Gem for Ruby on Rails.
MIT License
6.28k stars 785 forks source link

Checking class abilities #1003

Open yavora opened 10 years ago

yavora commented 10 years ago

Look, i have

can :create, Project { |instance| some_statement }  

Later i want to add such condition: if user can create some Project, then he can read ProjectTemplate. But i can't do this like this:

if can? :create, Project
  can :read, ProjectTemplate
end

because if-condition always true. Also, i can't just put can? :create, Project.new, because in my can :create, Project {} statement is not just .new object. Any suggestions? Am i doing something wrong?

Thanks.

xhoy commented 10 years ago

Thanks for your submission! The ryanb/cancan repository has been inactive since Sep 06, 2013. Since only Ryan himself has commit permissions, the CanCan project is on a standstill.

CanCan has many open issues, including missing support for Rails 4. To keep CanCan alive, an active fork exists at cancancommunity/cancancan. The new gem is cancancan. More info is available at #994.

If your pull request or issue is still applicable, it would be really appreciated if you resubmit it to CanCanCan.

We hope to see you on the other side!