
fr.zebasto.spring.identity.contract.model.Permission Maven / Gradle / Ivy
package fr.zebasto.spring.identity.contract.model;
import java.io.Serializable;
/**
* Description of a Permission
* A permission is composed of :
*
* - An action {@link Action}
* - An application {@link Application}
*
*
* The permission is used in spring security for protected access.
* You need to set your own implementation of getCode() so it returns the permission with the correct pattern.
*
* @param The parametrized type used to identify an entity {@link Serializable}
* @author Bastien Cecchinato
* @since 1.0.0
*/
public interface Permission {
/**
* Returns the Id of the permission
*
* @return The Id of the permission
* @since 1.0.0
*/
I getId();
/**
* Sets the Id of the permission
*
* @param id The id to set
* @since 1.0.0
*/
void setId(I id);
/**
* Returns the code associated to a permission
*
* @return The code associated to a permission
* @since 1.0.0
*/
String getCode();
/**
* Sets the code associated to a permission
*
* @param code The code to set
* @since 1.0.0
*/
void setCode(String code);
/**
* Returns the application associated to a permission
*
* @return The application associated to a permission
* @since 1.0.0
*/
Application getApplication();
/**
* @param application The application to set
* @since 1.0.0
*/
void setApplication(Application application);
/**
* Returns the action associated to a permission
*
* @return The action associated to a permission
* @since 1.0.0
*/
Action getAction();
/**
* Sets the action associated to a permission
*
* @param action The action to set
* @since 1.0.0
*/
void setAction(Action action);
}