litesoft
Diff Revisions
952
vs
953
for /trunk/GWT_Sandbox/InitFrom/src/org/litesoft/initfrom/server/pos/User.java
|
@@ -10,10 +10,11 @@ |
10 |
10 |
|
import org.litesoft.initfrom.server.*; |
11 |
11 |
|
import org.litesoft.orsup.selection.*; |
12 |
12 |
|
import org.litesoft.orsup.transact.*; |
|
13 |
+ |
import org.litesoft.security.*; |
13 |
14 |
|
|
14 |
15 |
|
import java.util.*; |
15 |
16 |
|
|
16 |
|
- |
public class User extends UserGO { |
|
17 |
+ |
public class User extends UserGO implements SecurityUser<User> { |
17 |
18 |
|
public User( Transaction pTransaction ) // Only used for New |
18 |
19 |
|
{ |
19 |
20 |
|
super( pTransaction ); |
|
@@ -34,10 +35,12 @@ |
34 |
35 |
|
protected void LLclearDemoUser() { |
35 |
36 |
|
} |
36 |
37 |
|
|
|
38 |
+ |
@Override |
37 |
39 |
|
public boolean isDemo() { |
38 |
40 |
|
return mDemo; |
39 |
41 |
|
} |
40 |
42 |
|
|
|
43 |
+ |
@Override |
41 |
44 |
|
public void setDemo() { |
42 |
45 |
|
mDemo = true; |
43 |
46 |
|
} |
|
@@ -50,7 +53,7 @@ |
50 |
53 |
|
|
51 |
54 |
|
@Override |
52 |
55 |
|
protected void LLsetHexPassword( String pHexPassword ) { |
53 |
|
- |
LLsetPassword( (pHexPassword == null) ? null : new String( HexStringCodec.decode( pHexPassword ) ) ); |
|
56 |
+ |
LLsetPassword( (pHexPassword == null) ? null : HexStringCodec.decode( pHexPassword ) ); |
54 |
57 |
|
} |
55 |
58 |
|
|
56 |
59 |
|
@Override |
|
@@ -183,6 +186,7 @@ |
183 |
186 |
|
return zAuthorizedRestrictedResources; |
184 |
187 |
|
} |
185 |
188 |
|
|
|
189 |
+ |
@Override |
186 |
190 |
|
public String acceptablePassword( String pPassword ) { |
187 |
191 |
|
if ( !isDemo() ) { |
188 |
192 |
|
if ( pPassword.length() < 8 ) { |
|
@@ -195,6 +199,7 @@ |
195 |
199 |
|
return null; |
196 |
200 |
|
} |
197 |
201 |
|
|
|
202 |
+ |
@Override |
198 |
203 |
|
public boolean validatePassword( String pPassword ) { |
199 |
204 |
|
return isDemo() || ConstrainTo.notNull( pPassword ).trim().equals( getPassword() ); |
200 |
205 |
|
} |
|
@@ -210,6 +215,7 @@ |
210 |
215 |
|
return zOptions.toArray( new RestrictedResource[zOptions.size()] ); |
211 |
216 |
|
} |
212 |
217 |
|
|
|
218 |
+ |
@Override |
213 |
219 |
|
public boolean canAccessAllRestrictedResources() { |
214 |
220 |
|
return Booleans.isAnyTrue( getRestrictedResourceManage(), getSuperAdmin(), getHelpDeskMember() ); |
215 |
221 |
|
} |