SkyPHP/skyphp — pull request #21 by stanistan (2012-02-22 20:20:22+00:00)
Title: getAuthFn/ auth_person uses getAuthFn()

wrote a function that returns auth functions.

usage:

```php

true // if true, this will check for the PERSON_ID constant if the parameter is not given
));

return $auth_fn($access_level_str, $person_id);

}

```

The `$constraints` array, the argument to `makeAuthFn` takes a key value pair of what the where criteria will be for the `$access_level_str`. The second paramater that the auth function accepts should generally be an array with keys matching the constraints, or empty, if there is one constraint, an array does not have to be used, the mapping happens automatically.