PermissionBeanLocal.java
891 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package fi.insomnia.bortal.beans;
import javax.ejb.Local;
import javax.resource.spi.IllegalStateException;
import fi.insomnia.bortal.enums.apps.IAppPermission;
import fi.insomnia.bortal.model.User;
@Local
public interface PermissionBeanLocal {
boolean hasPermission(IAppPermission perm);
User getCurrentUser();
boolean isLoggedIn();
boolean isCurrentUser(User thisuser);
boolean fatalPermission(IAppPermission perm, Object... failmessage) throws PermissionDeniedException;
// throws PermissionDeniedException;
void fatalNotLoggedIn() throws PermissionDeniedException;
User getAnonUser();
String getPrincipal();
/**
* Get common name of the logged in cert like "customer-01"
* @return CN of the certificate
* @throws IllegalStateException Principal has no CN
*/
String getCommonName() throws IllegalStateException;
// boolean hasPermission(String perm);
}