private List<Privilege> toPrivilege(List<String> rights)
{
List<Privilege> privileges = new ArrayList<Privilege>();
for (String right : rights)
{
Privilege p = new Privilege();
if ("all".equals(right))
{
p.getContent().add(new All());
}
else if ("bind".equals(right))
{
p.getContent().add(new Bind());
}
else if ("read".equals(right))
{
p.getContent().add(new Read());
}
else if ("read-acl".equals(right))
{
p.getContent().add(new ReadAcl());
}
else if ("read-current-user-privilege-set".equals(right))
{
p.getContent().add(new ReadCurrentUserPrivilegeSet());
}
else if ("unbind".equals(right))
{
p.getContent().add(new UnBind());
}
else if ("unlock".equals(right))
{
p.getContent().add(new Unlock());
}
else if ("write".equals(right))
{
p.getContent().add(new Write());
}
else if ("write-content".equals(right))
{
p.getContent().add(new WriteContent());
}
else if ("write-properties".equals(right))
{
p.getContent().add(new WriteProperties());
}
else
{
continue;
}