Revision 1211
org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.lib/src/main/java/org/gvsig/tools/identitymanagement/spi/AbstractSimpleIdentityManager.java | ||
---|---|---|
1 | 1 |
|
2 | 2 |
package org.gvsig.tools.identitymanagement.spi; |
3 | 3 |
|
4 |
import java.util.Collection; |
|
5 |
import java.util.Collections; |
|
6 |
import java.util.Set; |
|
7 |
import java.util.TreeSet; |
|
4 | 8 |
import org.gvsig.tools.identitymanagement.SimpleIdentityManager; |
5 | 9 |
|
6 | 10 |
public abstract class AbstractSimpleIdentityManager implements SimpleIdentityManager { |
7 | 11 |
|
12 |
protected Set registeredActions = null; |
|
13 |
|
|
14 |
protected AbstractSimpleIdentityManager() { |
|
15 |
this.registeredActions = new TreeSet(); |
|
16 |
} |
|
17 |
|
|
8 | 18 |
public boolean needDomain() { |
9 | 19 |
return false; |
10 | 20 |
} |
11 | 21 |
|
22 |
public void registerAction(String actionName) { |
|
23 |
this.registeredActions.add(actionName); |
|
24 |
} |
|
25 |
|
|
26 |
public Collection getActions() { |
|
27 |
return Collections.unmodifiableCollection(this.registeredActions); |
|
28 |
} |
|
12 | 29 |
} |
org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.lib/src/main/java/org/gvsig/tools/identitymanagement/SimpleIdentityManager.java | ||
---|---|---|
1 | 1 |
package org.gvsig.tools.identitymanagement; |
2 | 2 |
|
3 |
import java.util.Collection; |
|
3 | 4 |
import javax.naming.AuthenticationException; |
4 | 5 |
|
5 | 6 |
|
... | ... | |
49 | 50 |
* @param acction |
50 | 51 |
*/ |
51 | 52 |
public void sudo(String identityid, Runnable acction); |
53 |
|
|
54 |
/** |
|
55 |
* Register the actionName as an action that require authorization. |
|
56 |
* |
|
57 |
* @param actionName |
|
58 |
*/ |
|
59 |
public void registerAction(String actionName); |
|
60 |
|
|
61 |
/** |
|
62 |
* Return a list of the actions that are registered. |
|
63 |
* |
|
64 |
* @return list of action names that requiere authorization. |
|
65 |
*/ |
|
66 |
public Collection getActions(); |
|
52 | 67 |
} |
org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.lib/src/main/java/org/gvsig/tools/identitymanagement/impl/DumbIdentityManager.java | ||
---|---|---|
11 | 11 |
private SimpleIdentity current = null; |
12 | 12 |
|
13 | 13 |
public DumbIdentityManager() { |
14 |
super(); |
|
14 | 15 |
this.current = new DumbIdentity("guest"); |
15 | 16 |
} |
16 | 17 |
|
Also available in: Unified diff