2010-05-20 21:36:16 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2010
|
|
|
|
*
|
|
|
|
* Robert von Burg
|
|
|
|
* eitch@eitchnet.ch
|
|
|
|
*
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
package ch.eitchnet.privilege.handler;
|
|
|
|
|
2010-05-25 23:15:35 +02:00
|
|
|
import ch.eitchnet.privilege.base.PrivilegeContainerObject;
|
2010-05-24 21:21:46 +02:00
|
|
|
import ch.eitchnet.privilege.i18n.AccessDeniedException;
|
|
|
|
import ch.eitchnet.privilege.model.Certificate;
|
|
|
|
import ch.eitchnet.privilege.model.Restrictable;
|
2010-05-29 20:47:04 +02:00
|
|
|
import ch.eitchnet.privilege.model.internal.User;
|
2010-05-24 21:21:46 +02:00
|
|
|
|
2010-05-20 21:36:16 +02:00
|
|
|
/**
|
|
|
|
* @author rvonburg
|
|
|
|
*
|
|
|
|
*/
|
2010-05-25 23:15:35 +02:00
|
|
|
public interface SessionHandler extends PrivilegeContainerObject {
|
2010-05-20 21:36:16 +02:00
|
|
|
|
2010-05-24 21:21:46 +02:00
|
|
|
/**
|
|
|
|
* @param certificate
|
|
|
|
* @param restrictable
|
|
|
|
* @return
|
|
|
|
*
|
|
|
|
* @throws AccessDeniedException
|
|
|
|
* if the {@link Certificate} is not for a currently logged in {@link User} or if the user may not
|
|
|
|
* perform the action defined by the {@link Restrictable} implementation
|
|
|
|
*/
|
|
|
|
public boolean actionAllowed(Certificate certificate, Restrictable restrictable);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param user
|
|
|
|
* @param password
|
|
|
|
* @return
|
|
|
|
*
|
|
|
|
* @throws AccessDeniedException
|
|
|
|
* if the user credentials are not valid
|
|
|
|
*/
|
|
|
|
public Certificate authenticate(String user, String password);
|
2010-05-20 21:36:16 +02:00
|
|
|
}
|