Revision 1771 org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.lib/src/main/java/org/gvsig/tools/identitymanagement/impl/DumbIdentityManager.java

View differences:

DumbIdentityManager.java
12 12
    
13 13
    public DumbIdentityManager() {
14 14
        super();
15
        this.current = new DumbIdentity("guest");
15
        this.current = new DumbIdentity(this, "guest");
16 16
    }
17

  
18
    @Override
19
    public SimpleIdentity getIdentity(String identityid) {
20
        return new DumbIdentity(this, identityid);
21
    }
17 22
    
23
    
24
    @Override
18 25
    public void login(String domain, String identityid, String password) throws UnauthorizedException {
19
        this.current = new DumbIdentity(identityid);
26
        this.current = getIdentity(identityid);
20 27
    }
21 28

  
29
    @Override
22 30
    public void logout() {
23 31
        this.current = null;
24 32
    }
25 33

  
34
    @Override
26 35
    public SimpleIdentity getCurrentIdentity() {
27 36
        return this.current;
28 37
    }
29 38

  
39
    @Override
30 40
    public void sudo(String domain, String identityid, Runnable acction) {
31 41
        SimpleIdentity save = this.current;
32
        this.current = new DumbIdentity(identityid);
42
        this.current = getIdentity(identityid);
33 43
        try {
34 44
            acction.run();
35 45
        } finally {

Also available in: Unified diff