Skip to content

Deprecate ruby 2#7

Open
wkirby wants to merge 12 commits into
mainfrom
deprecate-ruby-2
Open

Deprecate ruby 2#7
wkirby wants to merge 12 commits into
mainfrom
deprecate-ruby-2

Conversation

@wkirby
Copy link
Copy Markdown
Contributor

@wkirby wkirby commented May 29, 2026

No description provided.

wkirby added 12 commits May 29, 2026 14:20
… :manage expansion

BREAKING CHANGE: :manage no longer expands to [:create, :read, :update, :destroy].
Use explicit action lists instead.

- Add scope: (aliases query:), if: (aliases predicate:), through: (aliases granted_by:)
- Raise ArgumentError when both old and new keyword names are passed
- Add collection: flag to grant; when true, auto-predicate is proc { true }
- Remove :manage -> CRUD expansion from Role#add_permission
- Rewrite README with collection/instance docs, fallthrough docs, upgrade guide
- Add specs for keyword aliases and collection permissions
… support via Callable

- Add PapersPlease::Delegation struct to replace raw [Class, Proc] tuples
- Add PapersPlease::Callable module for arity-safe proc/lambda invocation
- Permission now stores a Delegation instead of separate granted_by/granting_class
- All proc call sites go through Callable.call for lambda compat
- Lambdas with fewer params than the call site provides are handled gracefully
…call signatures

- Remove PapersPlease::Callable; lambdas work naturally with correct arity
- Delegation uses Data.define instead of Struct (immutable)
- Permission: attrs are readers not accessors, add matches_subject?
- Permission#granted?(user, subject) and #fetch(user, klass) have fixed signatures
  instead of variadic *args — no more silent action arg that nobody consumed
- Policy: fix can? mutating subject across role iterations via reassignment
- Policy: fix nil predicate return being treated as truthy with fallthrough
- Policy: remove unused @cache, make roles attr_reader
- Policy: resolve_delegation returns early on nil permission (delegated
  permission to nonexistent parent no longer falls through incorrectly)
@wkirby wkirby requested a review from egreer May 29, 2026 21:07
Copy link
Copy Markdown
Contributor

@egreer egreer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wkirby Lets go over these changes together at some point.

  • I don't think that we should remove the :manage. I think it generally simplifies config in general for simple cases so why was this removed? fae9a37

on:
push:
branches: [main]
branches: [master]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
branches: [master]
branches: [main]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants