1
|
/**
|
2
|
* Copyright (C) 2014 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.cdm.persistence.hibernate.permission;
|
10
|
|
11
|
import java.util.EnumSet;
|
12
|
|
13
|
import org.springframework.security.access.PermissionEvaluator;
|
14
|
import org.springframework.security.core.Authentication;
|
15
|
|
16
|
import eu.etaxonomy.cdm.model.common.CdmBase;
|
17
|
|
18
|
/**
|
19
|
* @author a.kohlbecker
|
20
|
* @since Feb 3, 2014
|
21
|
*
|
22
|
*/
|
23
|
public interface ICdmPermissionEvaluator extends PermissionEvaluator {
|
24
|
|
25
|
public boolean hasOneOfRoles(Authentication authentication, Role ... roles);
|
26
|
|
27
|
public <T extends CdmBase> boolean hasPermission(Authentication authentication, Class<T> targetDomainObjectClass,
|
28
|
EnumSet<CRUD> requiredOperations);
|
29
|
|
30
|
boolean hasPermission(Authentication authentication, CdmBase targetDomainObject, EnumSet<CRUD> requiredOperation);
|
31
|
|
32
|
/**
|
33
|
* @param authentication
|
34
|
* @param targetEntityStates
|
35
|
* @param requiredOperation
|
36
|
* @return
|
37
|
*/
|
38
|
boolean hasPermission(Authentication authentication, TargetEntityStates targetEntityStates,
|
39
|
EnumSet<CRUD> requiredOperation);
|
40
|
|
41
|
}
|