Package org.cyclos.impl.users
Class OperationPermissionHandlerImpl<E extends Enum<E> & PermissionOperation,DTO extends ProductDTO,AD extends ActiveProductsData>
- java.lang.Object
-
- org.cyclos.impl.users.PermissionHandlerImpl<DTO,AD>
-
- org.cyclos.impl.users.BasePermissionHandlerImpl<Set<E>,List<E>,DTO,AD>
-
- org.cyclos.impl.users.OperationPermissionHandlerImpl<E,DTO,AD>
-
public class OperationPermissionHandlerImpl<E extends Enum<E> & PermissionOperation,DTO extends ProductDTO,AD extends ActiveProductsData> extends BasePermissionHandlerImpl<Set<E>,List<E>,DTO,AD>
Handles mapping of related permissions according to an operation
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.users.BasePermissionHandlerImpl
dataProperty, dtoProperty, key
-
-
Constructor Summary
Constructors Constructor Description OperationPermissionHandlerImpl(SetProperty<E,? super DTO> dtoProperty, ListProperty<E,? super AD> dataProperty, MessageKey key)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EgetOperation(Permission permission)List<Permission>getPermissions()OperationPermissionHandlerImpl<E,DTO,AD>map(E operation, Permission permission)Maps the given operation to the given permission, and vice-versaOperationPermissionHandlerImpl<E,DTO,AD>master(E operation, Permission permission)Maps the given operation to the given permission, setting the given operation as master, and vice-versaCollection<E>readOperations(Collection<Permission> permissions)voidreadPermissions(Collection<Permission> permissions, AD data)Reads the permissions collection, setting the corresponding properties on the given Product datavoidreadPermissions(Collection<Permission> permissions, DTO dto)Reads the permissions collection, setting the corresponding properties on the given DTOvoidwritePermissions(DTO dto, Collection<Permission> permissions)Adds / removes corresponding permissions to the collection, according to the DTO properties-
Methods inherited from class org.cyclos.impl.users.BasePermissionHandlerImpl
getDTOProperty, getKey
-
-
-
-
Constructor Detail
-
OperationPermissionHandlerImpl
public OperationPermissionHandlerImpl(SetProperty<E,? super DTO> dtoProperty, ListProperty<E,? super AD> dataProperty, MessageKey key)
-
-
Method Detail
-
getOperation
public E getOperation(Permission permission)
-
getPermissions
public List<Permission> getPermissions()
- Specified by:
getPermissionsin classPermissionHandlerImpl<DTO extends ProductDTO,AD extends ActiveProductsData>- Returns:
- the list of permissions managed by this handler
-
map
public OperationPermissionHandlerImpl<E,DTO,AD> map(E operation, Permission permission)
Maps the given operation to the given permission, and vice-versa
-
master
public OperationPermissionHandlerImpl<E,DTO,AD> master(E operation, Permission permission)
Maps the given operation to the given permission, setting the given operation as master, and vice-versa
-
readOperations
public Collection<E> readOperations(Collection<Permission> permissions)
-
readPermissions
public void readPermissions(Collection<Permission> permissions, AD data)
Description copied from class:PermissionHandlerImplReads the permissions collection, setting the corresponding properties on the given Product data- Overrides:
readPermissionsin classPermissionHandlerImpl<DTO extends ProductDTO,AD extends ActiveProductsData>
-
readPermissions
public void readPermissions(Collection<Permission> permissions, DTO dto)
Description copied from class:PermissionHandlerImplReads the permissions collection, setting the corresponding properties on the given DTO- Overrides:
readPermissionsin classPermissionHandlerImpl<DTO extends ProductDTO,AD extends ActiveProductsData>
-
writePermissions
public void writePermissions(DTO dto, Collection<Permission> permissions)
Description copied from class:PermissionHandlerImplAdds / removes corresponding permissions to the collection, according to the DTO properties- Overrides:
writePermissionsin classPermissionHandlerImpl<DTO extends ProductDTO,AD extends ActiveProductsData>
-
-