net.ezcontent.impl.eos
Class Usuario

java.lang.Object
  extended bynet.ezcontent.impl.eos.base.BaseUsuario
      extended bynet.ezcontent.impl.eos.Usuario
All Implemented Interfaces:
Serializable, User

public class Usuario
extends BaseUsuario
implements User, Serializable

This is the object class that relates to the Usuario table. Any customizations belong here. Implementa User

See Also:
User, Serialized Form

Field Summary
 
Fields inherited from class net.ezcontent.impl.eos.base.BaseUsuario
 
Constructor Summary
Usuario()
           
Usuario(int uid)
          Constructor for primary key
Usuario(int uid, String username)
          Constructor for required fields
 
Method Summary
 List getGroups()
           
 List getPermissions()
          Devuelve una lista con los permisos que tiene el usuario.
 boolean hasPermission(String permName)
          Determinar si el usuario tiene el permiso con el nombre indicado.
 boolean isMemberOfGroup(Group g)
           
 void setGroups(List groups)
           
 String toString()
           
 
Methods inherited from class net.ezcontent.impl.eos.base.BaseUsuario
addToGrupos, equals, getFullname, getGrupos, getPassword, getUid, getUsername, hashCode, setFullname, setGrupos, setPassword, setUid, setUsername
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.ezcontent.auth.User
getFullname, getPassword, getUsername, setFullname, setPassword, setUsername
 

Constructor Detail

Usuario

public Usuario()

Usuario

public Usuario(int uid)
Constructor for primary key


Usuario

public Usuario(int uid,
               String username)
Constructor for required fields

Method Detail

setGroups

public void setGroups(List groups)
Specified by:
setGroups in interface User

getGroups

public List getGroups()
Specified by:
getGroups in interface User

getPermissions

public List getPermissions()
Devuelve una lista con los permisos que tiene el usuario.

Specified by:
getPermissions in interface User

hasPermission

public boolean hasPermission(String permName)
Determinar si el usuario tiene el permiso con el nombre indicado. Para ello, recorre todos los grupos a los que pertenece y compara el permiso contra los permisos de cada grupo. Si el usuario se llama admin entonces este metodo simplemente devuelve true.

Specified by:
hasPermission in interface User

isMemberOfGroup

public boolean isMemberOfGroup(Group g)
Specified by:
isMemberOfGroup in interface User

toString

public String toString()