@Override public boolean isChecked(Object obj) { User user = (User) obj; try { return UserLocalServiceUtil.hasRoleUser(_role.getRoleId(), user.getUserId()); } catch (Exception e) { _log.error(e, e); return false; } }
private boolean isAdmin(HttpServletRequest httpRequest) throws PortalException, SystemException { final long userId = PortalUtil.getUserId(httpRequest); final long companyId = PortalUtil.getDefaultCompanyId(); return UserLocalServiceUtil.hasRoleUser(companyId, RoleConstants.ADMINISTRATOR, userId, true); }