package com.cogeco.csmp.gwt.client;

import java.io.Serializable;

public class User implements Serializable {
	private String name = null;
	private boolean read = false;
	private boolean write = false;
	private boolean admin = false;
	
	public User() {
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	
	public boolean isRead() {
		return read;
	}

	public void setRead(boolean read) {
		this.read = read;
	}

	public boolean isWrite() {
		return write;
	}

	public void setWrite(boolean write) {
		this.write = write;
	}

	public boolean isAdmin() {
		return admin;
	}

	public void setAdmin(boolean admin) {
		this.admin = admin;
	}

	public String toString() {
		String s = name+" (";
		
		if (read) s += "R"; else s += "-";
		if (write) s += "W"; else s += "-";
		if (admin) s += "A)"; else s += "-)";
		
		return s;
	}
}
