kbrin80
kbrin80

Reputation: 409

How can I echo the User role using Kohana 2 Auth

Just trying to echo the role array of the current user to the screen using Kohana 2 and the Auth module.

Upvotes: 0

Views: 1730

Answers (1)

wesside
wesside

Reputation: 5740

If you have the models setup correctly..

$user_id = Auth::instance()->get_user()->id;
$roles = ORM::factory('user', $user_id)->roles;

foreach ($roles as $role)....etc.

Upvotes: 3

Related Questions