Opened 8 years ago

Closed 8 years ago

#1962 closed defect (fixed)

Trying to load item with ID=1 as parent item when inheriting annotations

Reported by: Nicklas Nordborg Owned by: Nicklas Nordborg
Priority: major Milestone: BASE 3.7
Component: web Version:
Keywords: Cc:

Description

As the root or admin user create two items, one being the parent of the other. For example one raw bioassay and one array design.

Create a user account and share the raw bioassay with write permission to that user but not the array design.

Log in as the other user and go to the edit dialog for the raw bioassay. The "Array design" field should be disabled and display 'denied'.

Switch to the "Annotations" tab and click on "Inherit". An error message is displayed:

Item not found: ArrayDesign[id=1]

The ID of the actual array design is NOT 1. The error message is a caused by the fact that when access is denied '-1' is used as the ID which is then passed on without the negative sign to the "Inherit" dialog which tries to load a non-existing item.

This issue is probably present in all places where annotations can be inherited.

Since negative values are also used for 'not modified', we can't use '-1' for 'denied' (there may be an item with ID=1!).

Change History (4)

comment:1 by Nicklas Nordborg, 8 years ago

(In [6999]) References #1962: Trying to load item with ID=1 as parent item when inheriting annotations

Seems like setting the value to "NaN" when permission is denied (and also for other non-selectable alternative) solves the problem.

Keeping this ticket open in case any side-effects are discovered.

comment:2 by Nicklas Nordborg, 8 years ago

(In [7000]) References #1962: Trying to load item with ID=1 as parent item when inheriting annotations

Need to check for 'NaN' instead of '0' in all list handling code before deciding if a new option should be inserted or if the existing option should be replaced.

comment:3 by Nicklas Nordborg, 8 years ago

Owner: changed from everyone to Nicklas Nordborg
Status: newassigned

comment:4 by Nicklas Nordborg, 8 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.