{"full_name":"coorasse/cancancan","owner":"coorasse","name":"cancancan","shard":"1","url":"https://github.com/coorasse/cancancan","description":"The authorization Gem for Ruby on Rails.","homepage":"","topics":["authorization","cancancan","rails"],"tag_pages":["authorization","rails"],"language":"Ruby","license":"MIT","avatar":"https://avatars.githubusercontent.com/u/1319150?u=fed92203a27888056f57b6cd4aa4ed33dcabb6ec&v=4","created_at":"2014-02-19T18:26:23Z","pushed_at":"2026-10-20T07:42:59Z","metrics":{"stars":5678,"forks":627,"watchers":91,"issues":433,"prs":488,"releases":12,"issues_open":1,"issues_closed":432,"prs_open":1,"prs_closed":184,"prs_merged":303,"discussions":14},"growth":{"day":{"stars":-1,"forks":0,"base_day":"2026-11-15"}},"history":{"dates":["2026-11-10","2026-11-11","2026-11-12","2026-11-13","2026-11-14","2026-11-15","2026-11-16"],"stars":[5680,5680,5680,5679,5679,5679,5678],"forks":[626,626,626,626,626,627,627],"watchers":[null,91,91,91,91,91,91],"issues_open":[null,0,0,0,0,1,1],"prs_open":[null,0,0,0,0,1,1]},"boards":{},"same_owner":[],"issues":[{"number":939,"title":"can? matches records of another model with the same id for a relation condition on a polymorphic association (3.7.0 regression)","comments":0,"created_at":"2026-11-14T12:52:08Z"}],"discussions":[{"number":886,"title":"Checking permissions on decorator in view","comments":0,"category":"Q&A","created_at":"2025-10-28T10:36:34Z"},{"number":879,"title":"cancancan with union join","comments":0,"category":"Q&A","created_at":"2025-04-14T04:13:48Z"},{"number":864,"title":"Custom override loading - How to handle errors?","comments":2,"category":"Q&A","created_at":"2024-09-05T22:40:54Z"},{"number":859,"title":"Access details about abilities programmatically, for generating documentation?","comments":1,"category":"Q&A","created_at":"2024-07-29T18:29:57Z"},{"number":840,"title":"How to authorize in multi-membership app?","comments":1,"category":"Q&A","created_at":"2024-03-13T15:36:04Z"},{"number":834,"title":"How to create a ability based on array values?","comments":0,"category":"Q&A","created_at":"2023-10-26T00:03:03Z"},{"number":819,"title":"CanCanCan Made Simple: Tips for New Users","comments":5,"category":"Ideas","created_at":"2023-02-23T13:32:14Z"},{"number":784,"title":"accessible_by strategies","comments":1,"category":"Q&A","created_at":"2022-05-02T19:52:06Z"}],"latest_release":{"name":"3.7.0","tag":"3.7.0","published_at":"2026-10-14T09:26:06Z","body":"The one below is a list of all the PRs merged. For a more detailed update, read the [blog post about this release](https://coorasse.com/blog/cancancan-3-dot-7-0-and-4-dot-0/).\r\n\r\n\r\n* Merge the `ControllerResourceLoader`, `ControllerResourceBuilder`, `ControllerResourceFinder`, `ControllerResourceNameFinder` and `ControllerResourceSanitizer` modules into `CanCan::ControllerResource`, and call the params method of the controller only once per request: it was called once more for every attribute set by the conditions of the ability. **WARNING**: the five modules no longer exist; override their methods in a subclass of `CanCan::ControllerResource` instead. ([@coorasse](https://github.com/coorasse))\r\n* Expand the actions again after `alias_action`, `clear_aliased_actions` and `merge`: `can?` kept using the aliases expanded by a previous check, so `clear_aliased_actions` did not remove `can :read` from `can?(:index, Model)`. ([@coorasse](https://github.com/coorasse))\r\n* Raise an error when an action is aliased to `:manage`, which granted every action, or to itself, which looped forever. ([@coorasse](https://github.com/coorasse))\r\n* Do not include the primary key in `permitted_attributes` for a rule without attributes, remove every attribute with a `cannot` rule without attributes, including those that are not columns, and accept a hash subject instead of raising a `TypeError`. **WARNING**: `permitted_attributes` no longer returns `:id`, and with a composite primary key none of its columns are returned. ([@coorasse](https://github.com/coorasse))\r\n* Convert a String resource name to a symbol in `load_and_authorize_resource` and the `skip_*` methods: `load_and_authorize_resource 'article'` treated the resource as a parent and authorized `:show` on the class instead of the action on the record. ([@coorasse](https://github.com/coorasse))\r\n* [#927](https://github.com/CanCanCommunity/cancancan/pull/927): Look up the unauthorized message of a String action through its aliases: `authorize!('index', post)` did not use the message defined for `read`. ([@coorasse](https://github.com/coorasse))\r\n* [#913](https://github.com/CanCanCommunity/cancancan/pull/913): Match a symbol in a condition with the string that has the same name in `can?`, as `accessible_by` already did: `cannot :read, Post, state: :draft` on a string column no longer allows `can?(:read, draft)`. **WARNING**: a `can` rule with a symbol now also allows records whose string attribute has the same name. ([@bruno-costanzo](https://github.com/bruno-costanzo))\r\n* [#905](https://github.com/CanCanCommunity/cancancan/pull/905): Match String actions like Symbol actions: `can?('destroy', user)` ignored `cannot :destroy, User` when `can :manage` was defined, and `skip_authorize_resource except: 'destroy'` also skipped the authorization of `destroy`. **WARNING**: a String action now goes through the aliases like a Symbol action, so `can?('show', order)` and `authorize!(action_name, order)` are allowed by `can :read, Order` and may grant access that 3.6 denied. A rule defined with a String action now matches the same Symbol action, `permissions` returns symbols, and a block rule without a subject receives the action as a symbol. ([@bruno-costanzo](https://github.com/bruno-costanzo))\r\n* [#848](https://github.com/CanCanCommunity/cancancan/issues/848): Do not deny `can?(:index, parent => Model)` because of a `cannot` rule with conditions on the model, as `can?(:index, Model)` already did: `load_and_authorize_resource` failed on the `index` of a nested resource. ([@coorasse](https://github.com/coorasse))\r\n* [#861](https://github.com/CanCanCommunity/cancancan/issues/861), [#846](https://github.com/CanCanCommunity/cancancan/issues/846), [#690](https://github.com/CanCanCommunity/cancancan/issues/690): Give the conditions of `accessible_by` the table aliases that Active Record gives to the joined associations, and build them with the model of each table. A rule with a `has_many :through` association, o","is_prerelease":false},"readme":true,"readme_zh":false,"news":[],"stale":false,"snapshot_at":"2026-11-16T09:23:14Z","history_start":"2026-09-06"}