class Person {
	static transients = ['pass']
    static hasMany = [authorities: Authority,
                        personGroups: PersonGroup,
                        modifications: Modification,
                        entries: Entry,
                        tasks: Task]

    static belongsTo = [Authority, PersonGroup]

	String loginName
	String firstName
    String lastName
    String employeeID

	/** MD5 Password */
	String password

	/** enabled */
	boolean isActive = true

	String email
	boolean emailShow = true

	/** description */
	String description = ''

	/** plain password to create a MD5 password */
	String pass = '[secret]'

	static constraints = {
		loginName(blank: false, unique: true)//minSize:7
		firstName(blank: false)
        lastName(blank: false)
		password(blank: false) //minSize:7
        employeeID(blank: true, nullable:true)
	}

    //Overriding the default toString method
    String toString() {"${this.firstName} ${this.lastName}"}
}
