@Override
public void setServerState(CellComponentServerState state) {
super.setServerState(state);
SecurityComponentServerState scss = (SecurityComponentServerState) state;
// make sure this user is an owner, and therefore has permission
// to set the server state of this component. Note we don't
// check the user if their ID is null (that means it is the system
// doing the setting) or if there are no owners.
ClientIdentityManager cim = AppContext.getManager(ClientIdentityManager.class);
WonderlandIdentity id = cim.getClientID();
if (id != null && owners != null && !owners.isEmpty()) {
// make a request to set the permissions if this is an owner
Resource ownerRsrc = new OwnerResource(cellRef.get().getCellID().toString(),
owners);
ActionMap am = new ActionMap(ownerRsrc, new OwnerAction());
ResourceMap rm = new ResourceMap();
rm.put(ownerRsrc.getId(), am);
SecurityManager sec = AppContext.getManager(SecurityManager.class);
SecureTask sst = new SetStateTask(id.getUsername(), ownerRsrc.getId(),
this, scss.getPermissions());
sec.doSecure(rm, sst);
} else {
// no security check, just set the values
setCellPermissions(scss.getPermissions());
}
}