Get users type in users controller

Hi,

I am working on functionality where I need to disable the regular user’s ability to edit their own profile.

I have found this script which I used but inside it, is_admin() function is used to grand access to admin users only to edit profile page.
https://sugarclub.sugarcrm.com/dev-club/f/questions-answers/927/restrict-regular-user-to-edit-profile

But, I want to get the current users type like regular/admin/anything else. How can I achieve this?

Hi

Try to use this below code, you may get user details.

global $current_user;
$user = BeanFactory::getBean(‘Users’, $current_user->id);

$fieldData = $user->my_field_c;

here you may get the type of user.