Statistics
| Revision:

gvsig-tools / org.gvsig.tools / library / trunk / org.gvsig.tools / org.gvsig.tools.lib / src / main / java / org / gvsig / tools / identitymanagement / SimpleIdentityManager.java @ 1771

History | View | Annotate | Download (1.91 KB)

1
package org.gvsig.tools.identitymanagement;
2

    
3
import java.util.Collection;
4
import java.util.List;
5

    
6

    
7
public interface SimpleIdentityManager {
8
    //
9
    // http://en.wikipedia.org/wiki/Identity_management
10
    //
11
    
12
    /**
13
     * Authenticate the identity in the system and stablish a session with this
14
     * identity.
15
     * If the identityid don't exists or the password specified is incorrect, throw
16
     * a exception.
17
     *
18
     * If the domain is not required it can not be null.
19
     *
20
     * @param domain, the domain used to authenticate the user
21
     * @param identityid, identity id to login in the system
22
     * @param password
23
     */
24
    public void login(String domain, String identityid, String password) throws UnauthorizedException;
25

    
26
    /**
27
     * Closes the session stablised with the current identity.
28
     */
29
    public void logout();
30

    
31
    /**
32
     * Return the identity of the current session in the system.
33
     * Can't be null.
34
     *
35
     * @return the current identity
36
     */
37
    public SimpleIdentity getCurrentIdentity();
38

    
39
    public SimpleIdentity getAdministrator();
40
    
41
    /**
42
     * Inform if the login process require a domain name.
43
     *
44
     * @return true if a domain name is required.
45
     */
46
    public boolean needDomain();
47
    
48
    /**
49
     * Run the specified action as the specified identity.
50
     * 
51
     * @param domain
52
     * @param identityid
53
     * @param acction 
54
     */
55
    public void sudo(String domain, String identityid, Runnable acction);
56
 
57
    /**
58
     * Register the actionName as an action that require authorization.
59
     * 
60
     * @param actionName 
61
     */
62
    public void registerAction(String actionName);
63
    
64
    /**
65
     * Return a list of the actions that are registered.
66
     * 
67
     * @return list of action names that requiere authorization.
68
     */
69
    public Collection getActions();
70
    
71
    public void addRule(Rule rule);
72
    
73
    public Collection<Rule> getRules();
74
}