Skip to content
This repository has been archived by the owner on Feb 24, 2023. It is now read-only.

Allow arrays of parameters to be used with @IsGranted #618

Merged
merged 1 commit into from Jul 3, 2019
Merged

Allow arrays of parameters to be used with @IsGranted #618

merged 1 commit into from Jul 3, 2019

Conversation

snebes
Copy link
Contributor

@snebes snebes commented May 24, 2019

This will allow @IsGranted annotation to pass an array of parameters to the security checker. For example:

@IsGranted("CAN_DO_THINGS", subject={"thing1", "thing2"})

The equivalent can be done using an expression in the @Security annotation, but using the @IsGranted annotation provides better readability.

@fabpot
Copy link
Member

fabpot commented Jul 3, 2019

Thank you @snebes.

@fabpot fabpot merged commit 296b733 into sensiolabs:master Jul 3, 2019
fabpot added a commit that referenced this pull request Jul 3, 2019
…nebes)

This PR was squashed before being merged into the 5.4.x-dev branch (closes #618).

Discussion
----------

Allow arrays of parameters to be used with @IsGranted

This will allow `@IsGranted` annotation to pass an array of parameters to the security checker.  For example:

```
@IsGranted("CAN_DO_THINGS", subject={"thing1", "thing2"})
```

The equivalent can be done using an expression in the `@Security` annotation, but using the `@IsGranted` annotation provides better readability.

Commits
-------

296b733 Allow arrays of parameters to be used with @IsGranted
@snebes snebes deleted the isgranted-array branch July 4, 2019 17:33
@dmaicher
Copy link
Contributor

dmaicher commented Sep 30, 2019

So actually this should now be deprecated? 🙈

See symfony/symfony#33584

Sorry I misunderstood this PR. Its about multiple subjects and not attributes 🤦‍♂️

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants