silverstripe-scienceninjas/sapphire — comment on commit 927dbbe717be3975c3e763bd462a8b6ebbe0a035
File: security/Permission.php line 627
By sminnee:

Right now, the API doesn't have any way of calling functions, instance methods, or closures.

Perhaps it would be better to pass an entire callable value as the value of the array? In the case of static method calls on the same class it would introduce a little redundancy, but it would let you to more with the TemplateGlobalProvider interface.

return array(
'HasPerm' => array('Permission', 'check'),
'TimesTwo' => function($ra) { return $ra * 2; }
);