package com.telephoners.krakyournet.ctf.beans;

import com.fasterxml.jackson.annotation.JsonProperty;
import org.ektorp.support.CouchDbDocument;

import java.security.Principal;

//todo: use CouchDbDocument
//todo: implement principal
public class User extends CouchDbDocument implements Principal
{
    private String name;
    private String password;
    private String email;
    private boolean admin = false;

    public User(String name, String password, String email, boolean admin)
    {
        this.name = name;
        this.password = password;
        this.email = email;
        this.admin = admin;
    }

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

    public boolean isAdmin()
    {
        return admin;
    }

    public User()
    {
    }

    public String getName()
    {
        return name;
    }

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

    public String getPassword()
    {
        return password;
    }

    public void setPassword(String password)
    {
        this.password = password;
    }

    public String getEmail()
    {
        return email;
    }

    public void setEmail(String email)
    {
        this.email = email;
    }
}
