Subversion Repositories general

Compare Revisions

Ignore whitespace Rev 948 → Rev 949

/sun/hostadmiral/trunk/src/ak/hostadmiral/core/model/User.java
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;
11,10 → 14,11
public class User
extends GeneralModelObject
{
private String login;
private String password;
private User boss;
private Boolean superuser;
private String login;
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
{