Allow a single user to use this menu
@param allowedUser allowed user
@return this
9814
public T allowedUser(User allowedUser) {
        this.userPredicate = (user) -> user.getId() == allowedUser.getId();
        return instance();
    }
649412
private boolean isAllowedUser(CmsUser user) throws CmsException {

        if (user.getOuFqn().startsWith(m_cms.getRequestContext().getOuFqn())) {
            return true;
        }
        return OpenCms.getRoleManager().getRolesOfUser(m_cms, user.getName(), m_ou, true, true, false).size() > 0;
    }
461364
@Nonnull
  public EChange disableUser (@Nullable final String sUserID)
  {
    final User aUser = getOfID (sUserID);
    if (aUser == null)
    {
      AuditHelper.onAuditModifyFailure (User.OT, sUserID, "no-such-user-id", "disable");
      return EChange.UNCHANGED;
    }

    m_aRWLock.writeLock ().lock ();
    try
    {
      if (aUser.setDisabled (true).isUnchanged ())
        return EChange.UNCHANGED;
      internalUpdateItem (aUser);
    }
    finally
    {
      m_aRWLock.writeLock ().unlock ();
    }
    AuditHelper.onAuditModifySuccess (User.OT, "disable", sUserID);

    // Execute callback as the very last action
    m_aCallbacks.forEach (aCB -> aCB.onUserEnabled (aUser, false));

    return EChange.CHANGED;
  }
1317538
@Override
    public void addUser(ApiBaseUser user) {
        try {
            room.addUser(CommandUtil.getSfsUser(user, api));
        } catch (SFSJoinRoomException e) {
            throw new IllegalStateException(e);
        }
    }
313633
public RestBuilder enableCors() {

		Set<String> allowedHeaders = new HashSet<>();
		allowedHeaders.add("Access-Control-Allow-Origin");
		//allowedHeaders.add("Access-Control-Allow-Credentials");
		allowedHeaders.add("Access-Control-Allow-Headers");
		allowedHeaders.add("Access-Control-Allow-Methods");
		allowedHeaders.add("Access-Control-Expose-Headers");
		allowedHeaders.add("Access-Control-Request-Method");
		allowedHeaders.add("Access-Control-Request-Headers");
		//allowedHeaders.add("Access-Control-Max-Age");
		allowedHeaders.add("Origin");
		return enableCors("*", false, -1, allowedHeaders);
	}
1348004
@Programmatic
    public ApplicationUser newDelegateUser(
            final String username,
            final ApplicationRole initialRole,
            final Boolean enabled) {
        final ApplicationUser user = getApplicationUserFactory().newApplicationUser();
        user.setUsername(username);
        user.setStatus(ApplicationUserStatus.parse(enabled));
        user.setAccountType(AccountType.DELEGATED);
        if (initialRole != null) {
            user.addRole(initialRole);
        }
        container.persistIfNotAlready(user);
        return user;
    }
375462
void displayUserPermissions(CmsUser user) {

        CmsPermissionView view = buildPermissionEntryForm(user.getId(), buildPermissionsForCurrentUser(), false, false);
        view.hideDeniedColumn();
        m_userPermissions.addComponent(view);
    }
114108
protected void addAllowedOuCondition(
        CmsSelectQuery select,
        TableAlias users,
        List<CmsOrganizationalUnit> allowedOus) {

        if ((allowedOus != null) && !allowedOus.isEmpty()) {
            CmsCompositeQueryFragment ouCondition = new CmsCompositeQueryFragment();
            ouCondition.setPrefix("(");
            ouCondition.setSuffix(")");
            ouCondition.setSeparator(" OR ");
            for (CmsOrganizationalUnit ou : allowedOus) {
                String ouName = CmsStringUtil.joinPaths("/", ou.getName());
                ouCondition.add(new CmsSimpleQueryFragment(users.column(colOu()) + " = ? ", ouName));
            }
            select.addCondition(ouCondition);
        }
    }
106096
public void withUser(boolean user) {
    if (user) {
      addQueryParameter(Constants.WITH_PARAM, Constants.WITH_USER);
    } else {
      removeQueryParameter(Constants.WITH_PARAM);
    }
  }
1327236
public void addUser(PrincipalUser user) {
        SystemAssert.requireArgument(user != null, "Null user can not be added.");
        users.add(user);
    }
380399
public final void setItsUser(final UserTomcat pItsUser) {
    this.itsUser = pItsUser;
    if (this.itsId == null) {
      this.itsId = new IdUserRoleTomcat();
    }
    this.itsId.setItsUser(this.itsUser);
  }
370244
private CmsPermissionSet buildPermissionsForCurrentUser() throws CmsException {

        CmsResourceUtil resUtil = new CmsResourceUtil(
            getCms(),
            getCms().readResource(getParamResource(), CmsResourceFilter.ALL));
        return resUtil.getPermissionSet();
    }
1351777
private List<CmsUser> getAllowedIndirects(List<CmsUser> allUsers, List<CmsUser> directUsers) {

        List<CmsUser> res = new ArrayList<CmsUser>();
        for (CmsUser u : allUsers) {
            if (!directUsers.contains(u)) {
                res.add(u);
            }
        }

        return res;
    }
1197142
public T authentication(String username, String password, boolean allowAnyHost) {
        if (StringUtils.isNotBlank(username)) {
            if (defaultHost == null || StringUtils.isBlank(defaultHost.getHostName())) {
                throw new IllegalStateException("Cannot configure authentication when host is not set.");
            }
            AuthScope authscope = allowAnyHost ?
                    new AuthScope(AuthScope.ANY_HOST, AuthScope.ANY_PORT, AuthScope.ANY_REALM) :
                    new AuthScope(defaultHost.getHostName(), AuthScope.ANY_PORT, AuthScope.ANY_REALM);
            credsProvider.setCredentials(authscope, new UsernamePasswordCredentials(username, password));
        }
        return self();
    }
183084
private void updateUser(CmsUser user) {

        setUserPasswordStatus(user, m_forceResetPassword.getValue().booleanValue());
        user.setDescription(m_description.getValue());
        user.setManaged(!m_selfmanagement.getValue().booleanValue());
        user.setEnabled(m_enabled.getValue().booleanValue());
        m_userdata.submit(user, m_cms, new Runnable() {

            public void run() {
                //
            }
        }, true);
    }
466990
protected HttpAction forbidden(final C context, final List<Client> currentClients, final List<UserProfile> profiles,
                                   final String authorizers) {
        return ForbiddenAction.INSTANCE;
    }
1201393
protected void addUserToRole(String user, String role) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.entry(tc, CLASS_NAME + "addUserToRole", new Object[] { user, role });
        }
        Set<String> usersForTheRole = roleToUserMap.get(role);
        if (usersForTheRole != null) {
            usersForTheRole.add(user);
        } else {
            usersForTheRole = new HashSet<String>();
            usersForTheRole.add(user);
        }
        roleToUserMap.put(role, usersForTheRole);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.exit(tc, CLASS_NAME + "addUserToRole");
        }
    }