public List getUsersContentPermissions() {
Map usersMap = new HashMap();
List allUsers = UserDao.createInstance().list();
for (Iterator it = allUsers.iterator(); it.hasNext(); ) {
User currentUser = (User) it.next();
UserContentPermissions ucp = new UserContentPermissions(this, currentUser);
usersMap.put(currentUser, ucp);
}
if (this.readUsers != null) {
for (Iterator it = this.readUsers.iterator(); it.hasNext(); ) {
User currentUser = (User) it.next();
UserContentPermissions ucp = (UserContentPermissions) usersMap.get(currentUser);
ucp.setReadable(true);
usersMap.put(currentUser, ucp);
}
}
if (this.writeUsers != null) {
for (Iterator it = this.writeUsers.iterator(); it.hasNext(); ) {
User currentUser = (User) it.next();
UserContentPermissions ucp = (UserContentPermissions) usersMap.get(currentUser);
ucp.setWritable(true);
usersMap.put(currentUser, ucp);
}
}
if (this.removeUsers != null) {
for (Iterator it = this.removeUsers.iterator(); it.hasNext(); ) {
User currentUser = (User) it.next();
UserContentPermissions ucp = (UserContentPermissions) usersMap.get(currentUser);
ucp.setRemoveable(true);
usersMap.put(currentUser, ucp);
}
}
if (this.ownerUsers != null) {
for (Iterator it = this.ownerUsers.iterator(); it.hasNext(); ) {
User currentUser = (User) it.next();
UserContentPermissions ucp = (UserContentPermissions) usersMap.get(currentUser);
ucp.setOwner(true);
usersMap.put(currentUser, ucp);
}
}