Task #8800 (closed)
Opened 12 years ago
Closed 12 years ago
Bug: canEdit etc True then False
Reported by: | wmoore | Owned by: | jamoore |
---|---|---|---|
Priority: | critical | Milestone: | OMERO-4.4 |
Component: | Security | Version: | n.a. |
Keywords: | n.a. | Cc: | atarkowska, cxallan |
Resources: | n.a. | Referenced By: | n.a. |
References: | n.a. | Remaining Time: | 0.0d |
Sprint: | 2012-05-22 (15) |
Description
I retrieve an image within the Blitz ImageWrapper?, calling canEdit() and canAnnotate() initially return True
E.g.:
return self.getDetails().getPermissions().canEdit()
but other calls on the imageWrapper in the template cause future canEdit() etc methods to return False. So we see that even in the same html template, some canEdit()s return True at the top of the page and False at the bottom (see screenshot).
Either of the two intervening methods in this case is enough to cause the bug. They are:
def countArchivedFiles (self): """ Returns the number of Original 'archived' Files linked to primary pixels. Value is cached """ if self._archivedFileCount is None: pid = self.getPixelsId() params = omero.sys.Parameters() params.map = {"pid": rlong(pid)} query = "select count(link.id) from PixelsOriginalFileMap as link where link.child.id=:pid" count = self._conn.getQueryService().projection(query, params, self._conn.CONFIG['SERVICE_OPTS']) self._archivedFileCount = count[0][0]._val return self._archivedFileCount
OR
def openAstexViewerCompatible(self): """ Is the image suitable to be viewed with the Volume viewer 'Open Astex Viewer' applet? Image must be a 'volume' of suitable dimensions and not too big. """ from django.conf import settings MAX_SIDE = settings.OPEN_ASTEX_MAX_SIDE # default is 400 MIN_SIDE = settings.OPEN_ASTEX_MIN_SIDE # default is 20 MAX_VOXELS = settings.OPEN_ASTEX_MAX_VOXELS # default is 15625000 (250 * 250 * 250) if self.image is None: return False sizeZ = self.image.getSizeZ() if self.image.getSizeC() > 1: return False sizeX = self.image.getSizeX() sizeY = self.image.getSizeY() if sizeZ < MIN_SIDE or sizeX < MIN_SIDE or sizeY < MIN_SIDE: return False if sizeX > MAX_SIDE or sizeY > MAX_SIDE or sizeZ > MAX_SIDE: return False voxelCount = (sizeX * sizeY * sizeZ) if voxelCount > MAX_VOXELS: return False try: # if scipy ndimage is not available for interpolation, can only handle smaller images import scipy.ndimage except ImportError: logger.debug("Failed to import scipy.ndimage - Open Astex Viewer limited to display of smaller images.") MAX_VOXELS = (160 * 160 * 160) if voxelCount > MAX_VOXELS: return False return True
Attachments (1)
Change History (2)
Changed 12 years ago by wmoore
comment:1 Changed 12 years ago by Will Moore <will@…>
- Remaining Time set to 0
- Resolution set to fixed
- Status changed from new to closed
(In [f940d90b59e527b0a02669dc1098f3725026d090/ome.git] on branch develop) Blitz ImageWrapper?.loadedHotSwap uses omero.group:gid. Fixes #8800
canEdit True (top) and False (bottom)