Open
Description
Description
Currently Symfony\Component\Security\Http\Attribute\IsGranted
is declared final
.
It would be helpful to make it non final so developers can use custom attributes to reuse roles that are used often. For example IsAdmin
etc..
Example
namespace Symfony\Component\Security\Http\Attribute;
class IsGranted {
// ...
}
namespace App\Security\Attribute;
class IsAdmin extends IsGranted {
public function __construct() {
parent::__construct("ROLE_ADMIN");
}
}
namespace App\Controller;
class AdminController {
#[IsAdmin]
public function adminAction() {}
}