flow-development-collection icon indicating copy to clipboard operation
flow-development-collection copied to clipboard

Allow to specify policies per action through annotations

Open albe opened this issue 5 years ago • 1 comments

Issue/suggestion original posted in #2059

As a helping hand to developers and integrators, creating Policy configuration via annotation from the method could be introduced.

To do this, we introduce a Policy annotation that let you annotated methods and have Flow automatically register a privilegeTarget in the MethodPriviliege configuration of the security framework

Original comments from #2059

@bwaidelich: As for Permissions I personally think that it is not a good idea to target controller actions at all since they should just delegate I/O..

@radmiraal: the @Flow\Policy itself sounds like (next to the ordering of course) the easiest one I think.

@albe: I'm all for the route thing, but not so sure about policy (policy IMO doesn't follow a 1:1 scheme like route:action)

albe avatar Jul 21 '20 09:07 albe

I was sceptical of this, but I do see it's usefulness now. Yes, policy:action is not always 1:1, but for the cases where it is, being able to annotate the action directly is super helpful.

albe avatar Mar 07 '21 12:03 albe