Skip to content

Sync Role Permissions

Kodeine edited this page Feb 23, 2015 · 1 revision

Sync Role Permissions

You can pass an array of role objects,ids or slugs to sync them to a user.

$roleAdmin->syncPermissions([1,2,3]);
$roleAdmin->syncPermissions('user, post');
$roleAdmin->syncPermissions((array($permUser, $permPost));

Note: The system will throw an exception if role does not exists.