Returns if the user agreement page should be shown for the current user.<p>

@return <code>true</code> if the user agreement page should be shown for the current user, otherwise <code>false</code>
335283
public boolean isShowUserAgreement() {

        if (!getSettings().isUserAgreementAccepted() && (getConfigurationContent() != null)) {
            CmsXmlContent content = getConfigurationContent();
            boolean enabled = false;
            try {
                // first read the property that contains the information if the agreement is enabled at all
                enabled = Boolean.valueOf(
                    getCms().readPropertyObject(
                        content.getFile(),
                        CmsPropertyDefinition.PROPERTY_LOGIN_FORM,
                        false).getValue()).booleanValue();
                if (enabled) {
                    // user agreement is enabled, now check version and accepted count
                    if (content.hasLocale(getLocale())) {
                        if (getAcceptedVersion() < getRequiredVersion()) {
                            // new user agreement version that has to be shown
                            return true;
                        } else {
                            // check how often the user accepted the user agreement
                            String countStr = content.getStringValue(getCms(), NODE_AGREE_COUNT, getLocale());
                            int count = Integer.parseInt(countStr);
                            if ((count == -1) || (getAcceptedCount() < count)) {
                                // user still has to accept the user agreement
                                return true;
                            }
                        }
                    }
                }
            } catch (Exception e) {
                // error when trying to determine if user agreement should be shown
                LOG.error(
                    Messages.get().getBundle().key(
                        Messages.LOG_USERAGREEMENT_SHOW_1,
                        getConfigurationContent().getFile().getRootPath()),
                    e);
            }

        }
        // store information that nothing has to be accepted in users session for better performance
        if (!getSettings().isUserAgreementAccepted()) {
            getSettings().setUserAgreementAccepted(true);
        }
        return false;
    }
227241
private boolean existsUser(String name) {

        CmsUser user = null;
        try {
            user = m_cms.readUser(name);
        } catch (CmsException e) {
            // this will happen, if the user does not exist
        }
        return user != null;
    }
907235
public boolean isCanPublish() {

        return OpenCms.getWorkplaceManager().getDefaultUserSettings().isAllowBrokenRelations()
            || OpenCms.getRoleManager().hasRole(getCms(), CmsRole.VFS_MANAGER);
    }
1322064
public boolean needUpdate() {

        String pool = "default";

        double currentVersion = 8.5;
        m_detectedVersion = 8.5;

        CmsSetupDb setupDb = new CmsSetupDb(null);

        try {
            setupDb.setConnection(
                getDbDriver(pool),
                getDbUrl(pool),
                getDbParams(pool),
                getDbUser(pool),
                m_dbPools.get(pool).get("pwd"));

            if (!setupDb.hasTableOrColumn("CMS_USERS", "USER_OU")) {
                m_detectedVersion = 6;
            } else if (!setupDb.hasTableOrColumn("CMS_ONLINE_URLNAME_MAPPINGS", null)) {
                m_detectedVersion = 7;
            } else if (!setupDb.hasTableOrColumn("CMS_USER_PUBLISH_LIST", null)) {
                m_detectedVersion = 8;
            }
        } finally {
            setupDb.closeConnection();
        }

        return currentVersion != m_detectedVersion;
    }
1340886
public boolean hasSubOUs() throws CmsException {

        List<CmsOrganizationalUnit> orgUnits = OpenCms.getOrgUnitManager().getOrganizationalUnits(
            getCms(),
            m_paramOufqn,
            true);
        if (orgUnits == null) {
            return false;
        }
        if (orgUnits.size() < 1) {
            return false;
        }
        return true;
    }
458125
protected boolean onlyVisibleForOU(CmsUUID userId) {

        try {
            if (m_app.isOUManagable(m_cms.readUser(userId).getOuFqn())) {
                return true;
            }
        } catch (CmsException e) {
            //
        }
        return false;
    }
825337
@Override
	public boolean isUserInRole(String role) {
		boolean inRole = false;

		Authentication authentication = getAuthentication();
		if (authentication != null) {
			Collection<? extends GrantedAuthority> authorities = authentication
					.getAuthorities();
			for (GrantedAuthority authority : authorities) {
				if (role.equals(authority.getAuthority())) {
					inRole = true;
					break;
				}
			}
		}
		return inRole;
	}
258989
public static boolean show(final Activity activity) {
        final SharedPreferences preferences = activity.getSharedPreferences(PREFERENCES_EULA,
                Activity.MODE_PRIVATE);
        if (!preferences.getBoolean(PREFERENCE_EULA_ACCEPTED, false)) {
            final AlertDialog.Builder builder = new AlertDialog.Builder(activity);
            builder.setTitle("License");
            builder.setCancelable(true);
            builder.setPositiveButton("Accept", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int which) {
                    accept(preferences);
                    if (activity instanceof OnEulaAgreedTo) {
                        ((OnEulaAgreedTo) activity).onEulaAgreedTo();
                    }
                }
            });
            builder.setNegativeButton("Refuse", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int which) {
                    refuse(activity);
                }
            });
            builder.setOnCancelListener(new DialogInterface.OnCancelListener() {
                public void onCancel(DialogInterface dialog) {
                    refuse(activity);
                }
            });
            builder.setMessage(readEula(activity));
            builder.create().show();
            return false;
        }
        return true;
    }
72051
protected boolean hasOuDetail() {

        CmsListMetadata meta = getList().getMetadata();
        CmsListItemDetails detail = meta.getItemDetailDefinition(LIST_DETAIL_OTHEROU);
        return (detail != null) && detail.isVisible();
    }
612892
public boolean shouldDisplay(String operationId, PMSecurityUser user) {
        if (operationId == null) {
            return false;
        }
        //First we check permissions
        for (FieldOperationConfig config : getConfigs()) {
            if (config.includes(operationId)) {
                if (config.getPerm() != null && user != null && !user.hasPermission(config.getPerm())) {
                    return false;
                }
            }
        }
        if (getDisplay().equalsIgnoreCase("all")) {
            return true;
        }
        final String[] split = getDisplay().split("[ ]");
        for (String string : split) {
            if (string.equalsIgnoreCase(operationId)) {
                return true;
            }
        }
        return false;
    }
1372289
protected boolean isAlreadyAvailable(String userName) {

        List<CmsUser> availableUsers;
        try {
            availableUsers = OpenCms.getOrgUnitManager().getUsers(getCms(), m_ou, false);
        } catch (CmsException e) {
            availableUsers = new ArrayList<CmsUser>();
        }
        Iterator<CmsUser> itAvailableUsers = availableUsers.iterator();
        while (itAvailableUsers.hasNext()) {
            if (userName.equals(itAvailableUsers.next().getSimpleName())) {
                return true;
            }
        }
        return false;
    }
469000
public boolean hasPermission(AccessControlList acl, String[] permission, Identity user)
   {

      String userId = user.getUserId();

      if (userId.equals(IdentityConstants.SYSTEM))
      {
         // SYSTEM has permission everywhere
         return true;
      }
      else if (userId.equals(acl.getOwner()))
      {
         // Current user is owner of node so has all privileges
         return true;
      }
      else if (userId.equals(IdentityConstants.ANONIM))
      {
         List<String> anyPermissions = acl.getPermissions(IdentityConstants.ANY);

         if (anyPermissions.size() < permission.length)
            return false;

         for (int i = 0; i < permission.length; i++)
         {
            if (!anyPermissions.contains(permission[i]))
               return false;
         }

         return true;
      }
      else
      {

         if (acl.getPermissionsSize() > 0 && permission.length > 0)
         {
            // check permission to perform all of the listed actions
            for (int i = 0; i < permission.length; i++)
            {
               // check specific actions
               if (!isPermissionMatch(acl.getPermissionsList(), permission[i], user))
                  return false;
            }
            return true;
         }
         return false;

      }
   }
443969
public function isAllowedCurrentPage()
    {
        if (!$this->isActive()) {
            return false;
        }

        $this->_initAllowedPages();
        
        if (!$this->getCurrentPage()) {
            return false;
        }
        
        return isset($this->_allowedPages[$this->getCurrentPage()]);
    }
540443
public boolean isUserGuest(String userName) {

        if (CmsStringUtil.isEmptyOrWhitespaceOnly(userName)) {
            return false;
        }
        return m_userGuest.equals(userName);
    }
153630
public boolean showPreviousPage() {
		AbstractWizardPage previousPage;
		try {
			previousPage = pageHistory.pop();
		} catch (EmptyStackException e) {
			// Previous page is null. Updating buttons and ignoring request.
			updateButtons();
			return false;
		}
		setPage(previousPage);
		return true;
	}
851362
public boolean isDetailPageAvailable() {

        boolean result = false;
        if ((m_cms != null)
            && (m_element != null)
            && !m_element.isInMemoryOnly()
            && (m_element.getResource() != null)) {
            try {
                String detailPage = OpenCms.getADEManager().getDetailPageFinder().getDetailPage(
                    m_cms,
                    m_element.getResource().getRootPath(),
                    m_cms.getRequestContext().getUri(),
                    null);
                result = detailPage != null;
            } catch (CmsException e) {
                LOG.warn(e.getLocalizedMessage(), e);
            }
        }
        return result;
    }
340314
public boolean readCurrentUser()
    {
        String strUserName = this.getProperty(DBParams.USER_NAME);
        String strUserID = this.getProperty(DBParams.USER_ID);
        boolean bUserFound = false;
        if ((this.getMainRecord().getEditMode() == DBConstants.EDIT_CURRENT) || (this.getMainRecord().getEditMode() == DBConstants.EDIT_IN_PROGRESS))
        {
            bUserFound = true;
        }
        else
        {
            if ((strUserID != null) && (strUserID.length() > 0))
            {
                bUserFound = ((UserInfo)this.getMainRecord()).getUserInfo(strUserID, false);
                if (bUserFound)
                    if (this.getMainRecord().getField(UserInfo.READ_ONLY_RECORD).getState() == true)
                        bUserFound = false; // Can't change anonymous
            }
            if (!bUserFound)
                if ((strUserName != null) && (strUserName.length() > 0))
            {
                bUserFound = ((UserInfo)this.getMainRecord()).getUserInfo(strUserName, false);
                if (bUserFound)
                    if (this.getMainRecord().getField(UserInfo.READ_ONLY_RECORD).getState() == true)
                        bUserFound = false; // Can't change anonymous
            }
        }
        if (!bUserFound)
        {
            try {
                this.getMainRecord().addNew();
            } catch (DBException e) {
                e.printStackTrace();
            }
            this.getMainRecord().getField(UserInfo.USER_NAME).setString(strUserName);
            this.getMainRecord().getField(UserInfo.USER_NAME).setModified(false);   // Don't force a write
        }
        else
        {
            // TODO What do I do if this user exists?
        }
        
        return bUserFound;
    }