コード例 #1
0
  @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;
    }
  }
コード例 #2
0
 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);
 }