Opened 18 years ago

Closed 18 years ago

#206 closed enhancement (fixed)

Display and filter on permisssion in lists

Reported by: Nicklas Nordborg Owned by: Nicklas Nordborg
Priority: critical Milestone: BASE 2.0
Component: web Version:
Keywords: Cc:

Description (last modified by Nicklas Nordborg)

This is very annoying when these listings are used for linking item A to item B. If the user doesn't have USE permission on item B a PermissionDeniedException is thrown when saving A. It would be better if the list displayed only those items that the user has at least USE permission for.

Change History (5)

comment:1 by Nicklas Nordborg, 18 years ago

Milestone: BASE 2.0

comment:2 by Nicklas Nordborg, 18 years ago

Description: modified (diff)
Priority: minorcritical
Summary: "Select item" listings are displaying items which the user doesn't have USE permission forDisplay and filter on permisssion in lists
Type: defectenhancement

This ticket is now part of tickets #268, #269, #270, #271 and #272.

comment:3 by Nicklas Nordborg, 18 years ago

Status: newassigned

comment:4 by Nicklas Nordborg, 18 years ago

The infrastructure for this ticket is now in place. The most important change is the new setItemPermission() method on the EntityQuery class. With this it is possible to set the permission that is required for the logged in user.

I have tested this on the Labels list page, which can be used as a reference. In summary there are four changes that are needed:

1: Add an import statement:

import="net.sf.basedb.clients.web.PermissionUtil"

2: Add the 'mode' parameter to the method call that configures the query:

final ItemQuery<Label> query = Base.getConfiguredQuery(cc, true, Label.getQuery(), mode);

3: Add a new column definition:

<tbl:columndef
   id="permission"
   title="Permission"
/>

4: Add a new table cell:

<tbl:cell column="permission"><%=PermissionUtil.getShortPermissions(item)%></tbl:cell>

comment:5 by Nicklas Nordborg, 18 years ago

Resolution: fixed
Status: assignedclosed

(In [2343]) Fixes #206: Display and filter on permisssion in lists

NOTE! This fixes the infrastructure only. The functionality still has to be added to individual pages. See the Labels list page for a working implementation.

Note: See TracTickets for help on using tickets.