src/main/java/org/geppetto/frontend/controllers/ConnectionHandler.java
public void checkUserPrivileges(String requestID)
	{
		boolean hasPersistence = false;
		try
		{
			hasPersistence = !AuthServiceCreator.getService().isDefault();
		}
		catch(GeppettoInitializationException e)
		{
			error(e, "Unable to determine whether persistence services are available or not");
		}

		UserPrivilegesDT userPrivileges = new UserPrivilegesDT();
		if(this.geppettoManager.getUser() != null)
		{
			userPrivileges.userName = this.geppettoManager.getUser().getLogin();
		}
		userPrivileges.hasPersistence = hasPersistence;
		userPrivileges.loggedIn = this.geppettoManager.getUser() != null;

		if(this.geppettoManager.getUser() != null)
		{
			List<UserPrivileges> privileges = this.geppettoManager.getUser().getUserGroup().getPrivileges();
			for(UserPrivileges up : privileges)
			{
				userPrivileges.privileges.add(up.toString());
			}
		}
		websocketConnection.sendMessage(requestID, OutboundMessages.USER_PRIVILEGES, getGson().toJson(userPrivileges));
	}
/**
	 * Sends to the client login user privileges
	 * 
	 * @param requestID
	 */
Sends to the client login user privileges

@param requestID
Sends to the client login user privileges @param requestID
public void checkUserPrivileges(String requestID)
	{
		boolean hasPersistence = false;
		try
		{
			hasPersistence = !AuthServiceCreator.getService().isDefault();
		}
		catch(GeppettoInitializationException e)
		{
			error(e, "Unable to determine whether persistence services are available or not");
		}
		UserPrivilegesDT userPrivileges = new UserPrivilegesDT();
		if(this.geppettoManager.getUser() != null)
		{
			userPrivileges.userName = this.geppettoManager.getUser().getLogin();
		}
		userPrivileges.hasPersistence = hasPersistence;
		userPrivileges.loggedIn = this.geppettoManager.getUser() != null;
		if(this.geppettoManager.getUser() != null)
		{
			List<UserPrivileges> privileges = this.geppettoManager.getUser().getUserGroup().getPrivileges();
			for(UserPrivileges up : privileges)
			{
				userPrivileges.privileges.add(up.toString());
			}
		}
		websocketConnection.sendMessage(requestID, OutboundMessages.USER_PRIVILEGES, getGson().toJson(userPrivileges));
	}
public void checkUserPrivileges ( String requestID ) { boolean hasPersistence = false ; try { hasPersistence = ! AuthServiceCreator . getService ( ) . isDefault ( ) ; } catch ( GeppettoInitializationException e ) { error ( e , "Unable to determine whether persistence services are available or not" ) ; } UserPrivilegesDT userPrivileges = new UserPrivilegesDT ( ) ; if ( this . geppettoManager . getUser ( ) != null ) { userPrivileges . userName = this . geppettoManager . getUser ( ) . getLogin ( ) ; } userPrivileges . hasPersistence = hasPersistence ; userPrivileges . loggedIn = this . geppettoManager . getUser ( ) != null ; if ( this . geppettoManager . getUser ( ) != null ) { List < UserPrivileges > privileges = this . geppettoManager . getUser ( ) . getUserGroup ( ) . getPrivileges ( ) ; for ( UserPrivileges up : privileges ) { userPrivileges . privileges . add ( up . toString ( ) ) ; } } websocketConnection . sendMessage ( requestID , OutboundMessages . USER_PRIVILEGES , getGson ( ) . toJson ( userPrivileges ) ) ; }
Sends to the client login user privileges
Sends to the client login user privileges