}
public PermissionableObjectDWR getAsset(String inodeOrIdentifier) throws DotHibernateException {
UserWebAPI userWebAPI = WebAPILocator.getUserWebAPI();
WebContext ctx = WebContextFactory.get();
HttpServletRequest request = ctx.getHttpServletRequest();
PermissionableObjectDWR asset = new PermissionableObjectDWR();
PermissionAPI permAPI = APILocator.getPermissionAPI();
Permissionable p = null;
asset.setId(inodeOrIdentifier);
try {
// Retrieving the current user
User user = userWebAPI.getLoggedInUser(request);
Structure hostStrucuture = StructureCache.getStructureByVelocityVarName("Host");
if (InodeFactory.isInode(inodeOrIdentifier)) {
Inode inode = InodeFactory.find(inodeOrIdentifier);
p = inode;
asset.setType(((Permissionable) inode).getClass().getName());
} else {
ContentletAPI contAPI = APILocator.getContentletAPI();
Contentlet content = contAPI.find(inodeOrIdentifier, user, false);
if (UtilMethods.isSet(content) && content.getStructureInode().equals(hostStrucuture.getInode())) {
p = content;
asset.setType(Host.class.getName());
}
}
if(p==null) return null;
asset.setIsFolder(p instanceof Folder);
asset.setIsHost((p instanceof Host) || ((p instanceof Contentlet) && ((Contentlet)p).getStructureInode().equals(hostStrucuture.getInode())));
asset.setIsParentPermissionable(p.isParentPermissionable());
asset.setDoesUserHavePermissionsToEdit(permAPI.doesUserHavePermission(p, PermissionAPI.PERMISSION_EDIT_PERMISSIONS, user));
} catch(DotHibernateException de) {
throw de;
} catch (Exception e) {
e.printStackTrace();
}