rafalp/PirxFramework — Issue #19: Add "ACL=>FALLBACK" check to Routers
Author: rafalp
Created: 2011-12-30 17:08:03+00:00
State: open
Labels: Pain in ass

if "ACL" key is defined in route variables, it will be saw by router as command to run additional check with ACL service before making decision if match is allowed.

Flow is following:

See if ACL is array, if it does see if "fallback" and "allowed" keys are allowed. If none are defined, assume that array content stands for allowed. First item of allowed is permission provider, second item is permission name, optional third argument is permission target. If target is string, first see if such variable exsists in route, if it does, overwrite variable with route value.

If match fails, set "errorACL" variable and see if fallback is defined. If it does, overwrite controller action (if its string) or route variables (if array). If its not defined, dont match route.