Subversion Repositories general

Compare Revisions

Ignore whitespace Rev 920 → Rev 921

/sun/hostcaptain/trunk/src/ak/hostcaptain/core/model/Mailbox.java
1,6 → 1,8
package ak.hostcaptain.core.model;
 
import ak.hostcaptain.util.Digest;
import ak.hostcaptain.util.ModelException;
import ak.hostcaptain.util.ModelSecurityException;
 
/**
*
31,7 → 33,7
return id;
}
 
public void setId(Long id)
protected void setId(Long id)
{
this.id = id;
}
45,26 → 47,36
return login;
}
 
public void setLogin(String login)
protected void setLogin(String login)
{
this.login = login;
}
 
public void setLogin(User editor, String login)
throws ModelException
{
if(!editableBy(editor))
throw new ModelSecurityException();
 
this.login = login;
}
 
/**
*
* @hibernate.property
*/
public String getPassword()
protected String getPassword()
{
return password;
}
 
public void setPassword(String password)
protected void setPassword(String password)
{
this.password = password;
}
 
public void setNewPassword(String password)
public void setPassword(User editor, String password)
throws ModelException
{
if(password == null)
throw new NullPointerException("Null password");
81,11 → 93,20
return domain;
}
 
public void setDomain(InetDomain domain)
protected void setDomain(InetDomain domain)
{
this.domain = domain;
}
 
public void setDomain(User editor, InetDomain domain)
throws ModelException
{
if(!editableBy(editor))
throw new ModelSecurityException();
 
this.domain = domain;
}
 
/**
*
* @hibernate.many-to-one
95,11 → 116,20
return owner;
}
 
public void setOwner(User owner)
protected void setOwner(User owner)
{
this.owner = owner;
}
 
public void setOwner(User editor, User owner)
throws ModelException
{
if(!editableBy(editor))
throw new ModelSecurityException();
 
this.owner = owner;
}
 
/**
*
* @hibernate.property
109,11 → 139,20
return virusCheck;
}
 
public void setVirusCheck(Boolean virusCheck)
protected void setVirusCheck(Boolean virusCheck)
{
this.virusCheck = virusCheck;
}
 
public void setVirusCheck(User editor, Boolean virusCheck)
throws ModelException
{
if(!editableBy(editor))
throw new ModelSecurityException();
 
this.virusCheck = virusCheck;
}
 
/**
*
* @hibernate.property
123,11 → 162,20
return spamCheck;
}
 
public void setSpamCheck(Boolean spamCheck)
protected void setSpamCheck(Boolean spamCheck)
{
this.spamCheck = spamCheck;
}
 
public void setSpamCheck(User editor, Boolean spamCheck)
throws ModelException
{
if(!editableBy(editor))
throw new ModelSecurityException();
 
this.spamCheck = spamCheck;
}
 
/**
*
* @hibernate.many-to-one
137,11 → 185,20
return systemUser;
}
 
public void setSystemUser(SystemUser systemUser)
protected void setSystemUser(SystemUser systemUser)
{
this.systemUser = systemUser;
}
 
public void setSystemUser(User editor, SystemUser systemUser)
throws ModelException
{
if(!editableBy(editor))
throw new ModelSecurityException();
 
this.systemUser = systemUser;
}
 
public String getTypeKey()
{
return ak.hostcaptain.core.CoreResources.TYPE_MAILBOX;
171,4 → 228,12
{
return user.isSuperuser() || user.equals(domain.getOwner());
}
 
protected static boolean allowedToCreate(MailboxManager manager, User editor)
throws ModelException
{
return editor.isSuperuser()
|| InetDomainManager.getInstance().areInetDomainsAvailable(editor);
}
}