Edgewall Software

Opened 10 years ago

Last modified 9 years ago

#11707 closed enhancement

Module and other classes should have a realm attribute — at Version 4

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 1.1.3
Component: general Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:

The IResourceManager implementation defines the realm through a class attribute, which is then assigned to model and module classes (classes implementing IResourceHandler). This allows the singly-defined realm attribute to be used throughout the package and avoids the repeated use of static strings.

API Changes:
Internal Changes:

Description

This is a follow-on to #11609 in which the realm attribute was added to Model objects. I propose to add a realm attribute to other classes, including those implementing IRequestHandler (i.e. the "Module" classes), with the realm being assigned from the class attribute defined in the class implementing IResourceManager.

This should help avoid regressions like the one mentioned in comment:12:ticket:11697.

Change History (4)

comment:1 by Ryan J Ollos, 10 years ago

This gets a bit confusing, because while query is not a realm on which permission checks are done, it is passed as an argument to web_context for the resource or realm parameter:

The basic idea I had for the changes here can be found in log:rjollos.git:t11707, but more investigation needs to be done. Fix for regression in [13055#file1] included in [a6a1b8a0/rjollos.git#file2], but I'll push a fix to the trunk now.

comment:2 by Christian Boos, 10 years ago

I think you're right that 'query' can't be considered to be a realm. However, what if one wants to restrict access to the query module? In this case, it could be handled as an "action" on the 'ticket' realm ('query' in perm('ticket') in idealized Trac API ;-) ).

comment:3 by Ryan J Ollos, 9 years ago

Owner: set to Ryan J Ollos
Status: newassigned

comment:4 by Ryan J Ollos, 9 years ago

Release Notes: modified (diff)

Proposed changes in log:rjollos.git:t11707.1.

Note: See TracTickets for help on using tickets.