Skip to content

[Bug]: Predicate functions should respect action grouping #50

@vincentvanbush

Description

@vincentvanbush

Permit version

0.3.1

Elixir/OTP version

1.19 / 28

Bug description

Predicate functions injected by use Permit based on the actions module should respect action grouping, just like Permit.Phoenix now does. That is, if show: [:read] is defined, then authorizing the :show action depends on the :read permission - so if :read is granted, then both read? and show? should return true. Right now show? returns false.

Steps to reproduce

Ask for the show? permission when read? is granted, given a show: [:read] action grouping.

Code sample

Expected behavior

show?/2 should return true

Actual behavior

show?/2 returns false

Error logs/stack trace

Additional context

No response

Checklist

  • I have searched for existing issues before creating this one
  • I have provided all the requested information
  • This is a bug report, not a feature request or question. For general questions, please use Elixir Slack's Permit channel.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions