Skip to content

Commit 01b49c0

Browse files
committed
feature #61504 [SecurityHttp] Removes final keyword from IsGranted attribute (crtl)
This PR was squashed before being merged into the 7.4 branch. Discussion ---------- [SecurityHttp] Removes final keyword from IsGranted attribute | Q | A | ------------- | --- | Branch? | 7.4 | Bug fix? | no | New feature? | yes | Deprecations? | no <!-- if yes, also update UPGRADE-*.md and src/**/CHANGELOG.md --> | Issues | Fix #60896 | License | MIT Often times the same set of rules is reused many times across a project making it tedious having to manually add the attributes with their specific configuration. Making `#[IsGranted]` non `final` allows developers to implement custom attributes like `#[IsAdmin]` etc. in their projects. Commits ------- 3392f34 [SecurityHttp] Removes final keyword from IsGranted attribute
2 parents f37691b + 3392f34 commit 01b49c0

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/Symfony/Component/Security/Http/Attribute/IsGranted.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* @author Ryan Weaver <ryan@knpuniversity.com>
2323
*/
2424
#[\Attribute(\Attribute::IS_REPEATABLE | \Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::TARGET_FUNCTION)]
25-
final class IsGranted
25+
class IsGranted
2626
{
2727
/** @var string[] */
2828
public readonly array $methods;

src/Symfony/Component/Security/Http/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ CHANGELOG
88
* Deprecate callable firewall listeners, extend `AbstractListener` or implement `FirewallListenerInterface` instead
99
* Deprecate `AbstractListener::__invoke`
1010
* Add `$methods` argument to `#[IsGranted]` to restrict validation to specific HTTP methods
11+
* Remove `final` keyword from `#[IsGranted]` to allow implementation of custom attributes
1112

1213
7.3
1314
---

0 commit comments

Comments
 (0)