Current user from ServiceContext. If ServiceContext is not set then
{@link ServiceContextFactory.SYSTEM_USER} is returned.
493802
public static String getCurrentUser() {
        ServiceContext ctx = ServiceContextStore.get();
        String currentUser;
        if (ctx == null) {
            currentUser = ServiceContextFactory.SYSTEM_USER;
        } else {
            currentUser = ctx.getUserId();
        }

        if (currentUser == null) {
            currentUser = ServiceContextFactory.UNKNOWN_USER;
        }
        return currentUser;
    }
786102
public User setUserContext(User userContext) throws InvalidArgumentException {

        if (null == cryptoSuite) {
            throw new InvalidArgumentException("No cryptoSuite has been set.");
        }
        userContextCheck(userContext);

        User ret = this.userContext;
        this.userContext = userContext;

        logger.debug(
                format("Setting user context to MSPID: %s user: %s", userContext.getMspId(), userContext.getName()));

        return ret;
    }
102902
public CompletionStage<Result> currentUser() {
        return SecureSocial.currentUser(env).thenApply( new Function<Object, Result>() {
            public Result apply(Object maybeUser) {
                String id;

                if ( maybeUser != null ) {
                    DemoUser user = (DemoUser) maybeUser;
                    id = user.main.userId();
                } else {
                    id = "not available. Please log in.";
                }
                return ok("your id is " + id);
            }
        });
    }
1042379
public static ServiceManagerProvider current()
  {
    ServiceManagerProvider systemProvider = _systemProvider;
    
    if (systemProvider != null) {
      return systemProvider;
    }
    
    Thread thread = Thread.currentThread();
    ClassLoader loader = thread.getContextClassLoader();
    
    return getProvider(loader);
  }
262038
public static systemuser_systemgroup_binding[] get(nitro_service service, String username) throws Exception{
		systemuser_systemgroup_binding obj = new systemuser_systemgroup_binding();
		obj.set_username(username);
		systemuser_systemgroup_binding response[] = (systemuser_systemgroup_binding[]) obj.get_resources(service);
		return response;
	}
62727
public ApiUser getUser(String name) {
        User sfsUser = CommandUtil.getSfsUser(name, api);
        if(sfsUser == null)
            return null;
        return (ApiUser) sfsUser.getProperty(APIKey.USER);
    }
1092695
@Override
	public SecurityContext getContext(String userName, String password) throws FFMQSecurityException 
	{
		if (userName == null)
			throw new FFMQSecurityException("User name not specified","INVALID_SECURITY_DESCRIPTOR");
		
		// Check user and password
		User user = descriptor.getUser(userName);
        if (user == null || !user.getPassword().equals(password))
            throw new FFMQSecurityException("Invalid user/password","INVALID_SECURITY_DESCRIPTOR");
        
        return user;
	}
1224725
public static String getContextServiceName()
    {
        ServiceContext context = (ServiceContext) _localContext.get();

        if (context != null)
            return context._serviceName;
        else
            return null;
    }
856405
def get_current_user(self, **params):
        """"""
        response = self._get('v2', 'user', params=params)
        return self._make_api_object(response, CurrentUser)
513761
private ContextUsersPanel getContextPanel(int contextId) {
		ContextUsersPanel panel = this.userPanelsMap.get(contextId);
		if (panel == null) {
			panel = new ContextUsersPanel(this, contextId);
			this.userPanelsMap.put(contextId, panel);
		}
		return panel;
	}
387449
@Nullable
  public StitchUserT getUser() {
    authLock.readLock().lock();
    try {
      return activeUser;
    } finally {
      authLock.readLock().unlock();
    }
  }
372795
public Exception getRootCause() {
		if (exception instanceof ServiceLocatorException) {
			return ((ServiceLocatorException) exception).getRootCause();
		}
		return exception == null ? this : exception;
	}
661509
public List<User> getUIConfiguredUsers(int contextId) {
		ContextUsersPanel panel = this.userPanelsMap.get(contextId);
		if (panel != null) {
			return Collections.unmodifiableList(panel.getUsersTableModel().getUsers());
		}
		return null;
	}
539640
def current_user():
    
    user_id = current_user_id()
    guard = current_guard()
    user = guard.user_class.identify(user_id)
    PraetorianError.require_condition(
        user is not None,
        "Could not identify the current user from the current id",
    )
    return user
187242
@Override
    public IPerson getCurrentPerson(final ExternalContext externalContext) {
        final HttpServletRequest servletRequest =
                getServletRequestFromExternalContext(externalContext);
        return personManager.getPerson(servletRequest);
    }
1201703
public static ServletRequest getContextRequest()
    {
        ServiceContext context = (ServiceContext) _localContext.get();

        if (context != null)
            return context._request;
        else
            return null;
    }
79949
def current(self):
        
        if not has_request_context():
            return self.no_req_ctx_user_stack.top
        user_stack = getattr(_request_ctx_stack.top, 'user_stack', None)
        if user_stack and user_stack.top:
            return user_stack.top
        return _get_user()