01: package org.emforge.jbpm;
02:
03: import org.acegisecurity.Authentication;
04: import org.acegisecurity.context.SecurityContextHolder;
05: import org.jbpm.security.AuthenticationService;
06:
07: /** Acegi based Authenticatoin Service for JBPM
08: *
09: * @author akakunin
10: *
11: */
12: public class AcegiAuthenticationService implements
13: AuthenticationService {
14: private static final long serialVersionUID = 1256948686469788162L;
15:
16: public String getActorId() {
17: Authentication auth = SecurityContextHolder.getContext()
18: .getAuthentication();
19:
20: if (auth != null) {
21: return auth.getName();
22: } else {
23: return null;
24: }
25: }
26:
27: public void close() {
28: }
29:
30: }
|