Welcome Guest, Not a member yet? Register   Sign In
Controller Filters - Input needed
#5

(07-07-2016, 09:21 PM)albertleao Wrote:
(07-07-2016, 09:14 PM)arma7x Wrote: Take a look at Sailjs Policies features concept at http://sailsjs.org/documentation/concepts/policies.

Doesn't seem too far different than psr-7 middleware featured in some other PHP frameworks.

It does seem be very similar to what you're asking for.

To play devil's advocate for a moment - is this necessary?

For one thing, it makes things a little more implicit by taking the control and logic away from anything the user sees if they dive in and look at the routes and controller files. Which, in turn, makes it a little more difficult to learn the framework for new users. The thing that would be done in it's place is what we've all done in the past - simply call a check explicitly in our controllers. Now, it's a little more work to manage, true, but diving into the controller we know exactly what's going on.

Is there possibly a solution that keeps it relatively explicit, but still helps solve the problem?
Reply


Messages In This Thread
Controller Filters - Input needed - by kilishan - 07-07-2016, 08:39 PM
RE: Controller Filters - Input needed - by arma7x - 07-10-2016, 06:46 AM
RE: Controller Filters - Input needed - by arma7x - 07-07-2016, 09:14 PM
RE: Controller Filters - Input needed - by kilishan - 07-07-2016, 09:39 PM
RE: Controller Filters - Input needed - by arma7x - 07-10-2016, 11:42 PM
RE: Controller Filters - Input needed - by arma7x - 07-12-2016, 01:55 AM
RE: Controller Filters - Input needed - by arma7x - 07-13-2016, 12:23 AM
RE: Controller Filters - Input needed - by arma7x - 07-14-2016, 12:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB