1,5 → 1,8 |
package ak.hostadmiral.core.model; |
|
import java.util.Collection; |
import java.util.Collections; |
|
import ak.hostadmiral.util.Digest; |
import ak.hostadmiral.util.ModelException; |
import ak.hostadmiral.util.ModelSecurityException; |
15,6 → 18,7 |
private String password; |
private User boss; |
private Boolean superuser; |
private Collection loginHistory; |
|
protected User() |
{ |
133,6 → 137,27 |
this.superuser = superuser; |
} |
|
/** |
* |
* @hibernate.set lazy="true" |
* @hibernate.collection-key column="usr" |
* @hibernate.collection-one-to-many class="ak.hostadmiral.core.model.UserLogin" |
*/ |
protected Collection getLoginHistory() |
{ |
return loginHistory; |
} |
|
public Collection getLogins() |
{ |
return Collections.unmodifiableCollection(loginHistory); |
} |
|
protected void setLoginHistory(Collection loginHistory) |
{ |
this.loginHistory = loginHistory; |
} |
|
public boolean equals(Object o) |
{ |
if(o == null || !(o instanceof User)) return false; |
189,6 → 214,11 |
return user.isSuperuser() && !user.equals(this); |
} |
|
public boolean mayViewAllLogins() |
{ |
return isSuperuser(); |
} |
|
protected static boolean allowedToCreate(UserManager manager, User editor) |
throws ModelException |
{ |