ryanb / cancan

Authorization Gem for Ruby on Rails.
MIT License
6.26k stars 784 forks source link

not checking for id #713

Open davesherratt opened 12 years ago

davesherratt commented 12 years ago

In the developer.log I see the sql is not checking for the correct ID of the user, instead checking for is null?

Processing by RetailUsersController#new as HTML RetailUser Load (2.0ms) SELECT "retail_users".* FROM "retail_users" WHERE "retail_users"."id" = 63 LIMIT 1 super_admin Role Load (1.5ms) SELECT "roles".* FROM "roles" INNER JOIN "retail_users_roles" ON "roles"."id" = "retail_users_roles"."role_id" WHERE "retail_users_roles"."retail_user_id" IS NULL AND "roles"."slug" = 'super_admin' LIMIT 1

andhapp commented 12 years ago

@davesherratt Can you please post the code that causes this? For example: ability definition, version of cancan, ruby and rails and the code that's triggering it. Without all the information, it'd be hard to figure out what's causing it.

Thanks.

davesherratt commented 12 years ago

@andhapp here's a paste dump of the code and version http://paste2.org/p/2098389 Are there any other bits you need?

bernardkroes commented 11 years ago

Is this still an issue, if so, could you also provide the code that is actually triggering the mentioned SQL statements (maybe RetailUsersController#new(?))?

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!