Skip to content

Instantly share code, notes, and snippets.

  • Save MaxLazar/ef229b05677398b125c48bcebdf5387f to your computer and use it in GitHub Desktop.
Save MaxLazar/ef229b05677398b125c48bcebdf5387f to your computer and use it in GitHub Desktop.
ExpressionEngine 6 check access to CP
$roleIds = ee('Permission')->rolesThatHave('can_access_cp', $siteId);
return ee('Model')->get('Role', $roleIds)->all()->getDictionary('role_id', 'name');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment