org.geebis.books.model.partner
Class Employee

java.lang.Object
  extended by org.geebis.books.model.partner.Partner
      extended by org.geebis.books.model.partner.Employee
All Implemented Interfaces:
java.io.Serializable

@Name(value="employee")
public class Employee
extends Partner
implements java.io.Serializable

See Also:
Serialized Form

Constructor Summary
Employee()
           
Employee(java.lang.String name)
           
Employee(java.lang.String name, java.lang.String username)
           
 
Method Summary
 void addPermission(Permission permission)
          Adds the passed in permission to the user
 boolean can(Permission... permissions)
          Returns true if the user has all of the passed in permissions or is an administrator, false otherwise
 boolean canAny(Permission... permissions)
          Returns true if the user has any of the passed in permissions, or is an administrator, false otherwise
 java.lang.Boolean getAdmin()
          Gets whether this employee is an administrator
 java.lang.String getEmployeeId()
          Gets the employee id for this employee
 java.lang.String getPassword()
           
 java.util.Set<EmployeePermission> getPermissions()
          Gets the employee's permissions
 java.lang.String getUsername()
           
 void removePermission(Permission permission)
          Removes the passed in permission from the user
 void setAdmin(java.lang.Boolean admin)
          Sets whether the employee is an administrator
 void setEmployeeId(java.lang.String employeeId)
          Sets the employee id for this employee
 void setPassword(java.lang.String password)
           
 void setPermissions(java.util.Set<EmployeePermission> permissions)
          Sets the employees permissions
 void setUsername(java.lang.String username)
           
 
Methods inherited from class org.geebis.books.model.partner.Partner
getAccountsPayableAccount, getAccountsReceivableAccount, getCompanyName, getContact, getContactInformation, getDefaultTerms, getFirstName, getGenderTitle, getId, getLabels, getLastName, getMiddleInitial, getName, getVersion, setAccountsPayableAccount, setAccountsReceivableAccount, setCompanyName, setContact, setContactInformation, setDefaultTerms, setFirstName, setGenderTitle, setId, setLabels, setLastName, setMiddleInitial, setName, setVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Employee

public Employee()

Employee

public Employee(java.lang.String name)

Employee

public Employee(java.lang.String name,
                java.lang.String username)
Method Detail

getUsername

public java.lang.String getUsername()

setUsername

public void setUsername(java.lang.String username)

getPassword

public java.lang.String getPassword()

setPassword

public void setPassword(java.lang.String password)

getEmployeeId

public java.lang.String getEmployeeId()
Gets the employee id for this employee

Returns:
the employeeId for this employee

setEmployeeId

public void setEmployeeId(java.lang.String employeeId)
Sets the employee id for this employee

Parameters:
employeeId - the new employee id for this employee

getAdmin

public java.lang.Boolean getAdmin()
Gets whether this employee is an administrator

Returns:
true if the employee is an administrator, false otherwise

setAdmin

public void setAdmin(java.lang.Boolean admin)
Sets whether the employee is an administrator

Parameters:
admin - the new value that determins whether this employee is an administrator

getPermissions

public java.util.Set<EmployeePermission> getPermissions()
Gets the employee's permissions

Returns:
the employee's permissions

setPermissions

public void setPermissions(java.util.Set<EmployeePermission> permissions)
Sets the employees permissions

Parameters:
permissions - the new permissions for this employee

addPermission

public void addPermission(Permission permission)
Adds the passed in permission to the user

Parameters:
permission - the permission to add

removePermission

public void removePermission(Permission permission)
Removes the passed in permission from the user

Parameters:
permission - the permission to remove

can

public boolean can(Permission... permissions)
Returns true if the user has all of the passed in permissions or is an administrator, false otherwise

Parameters:
permissions - the permissions to check for
Returns:
true if the user has the permissions, or is an administrator, false if otherwise

canAny

public boolean canAny(Permission... permissions)
Returns true if the user has any of the passed in permissions, or is an administrator, false otherwise

Parameters:
permissions - the permissions to check for
Returns:
true if the user has any of the passed in permissions, or is an administrator, false if otherwise