90,6 → 90,26 |
passwords.add(ps); |
} |
|
public String getPassword(User editor, String digest) |
throws ModelException |
{ |
if(!editableBy(editor)) |
throw new ModelSecurityException(); |
|
for(Iterator i = passwords.iterator(); i.hasNext(); ) { |
Object o = i.next(); |
if(!(o instanceof PasswordStore)) |
throw new ModelException("It's not a password store"); |
|
PasswordStore ps = (PasswordStore)o; |
if(ps.getDigest().equals(digest)) { |
return ps.getPassword(); |
} |
} |
|
throw new ModelException("Digest " + digest + " not found"); |
} |
|
public void setPassword(User editor, String password) |
throws ModelException |
{ |