<span class="variable">$perm</span> = \Model\Auth_Permission::forge();<br>$perm->area = 'tg'; //
<code data-result="[object Object]" class="php">name_of_application
$perm->permission = 'blog';
$perm->actions = ['add' , 'edit' , 'save' , ... ];
$perm->save();
then create some users ,<span class="variable">$user</span> = \Model\Auth_User::forge();<br>$user->username = 'user01';<br>$user->password = 'password';<br>$user->email = 'mail@mail.com';<br>$user->group = 3; // for normal user<br>$user->group = 5; // for admin user
$user->save();
now you can use has_access function for checking if current user has permission to do something or not,<span class="keyword">if</span> (Auth::has_access(<span class="string">'tg.blog[add,edit]'</span>))
{
<span class="comment">// yes, the user has access</span>
}
it is simple, and all code you need is in Auth section of docs.
It looks like you're new here. If you want to get involved, click one of these buttons!