Skip to content

Instantly share code, notes, and snippets.

@jenkoian
Created March 21, 2016 11:07
Show Gist options
  • Save jenkoian/5fda9fad505e12186bb5 to your computer and use it in GitHub Desktop.
Save jenkoian/5fda9fad505e12186bb5 to your computer and use it in GitHub Desktop.
PermissionUrlMap
<?php
//...
class PermissionUrlMap
{
/**
* Order matters, in that it will match the first one it comes across. So put more specific URLs higher up.
*
* @var array Format is [‘permission’ => ‘/path/to/page’]
*/
public static $permissionMap = [
‘add_content’ => ‘^/content/add’,
‘moderate_content’ => ‘^/content/moderate’,
‘edit_user’ => ‘^/user/edit’
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment