Edgewall Software

Opened 8 years ago

Closed 7 years ago

#11707 closed enhancement (fixed)

Module and other classes should have a realm attribute

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:
API Changes:

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.

Internal Changes:


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.

Attachments (0)

Change History (6)

comment:1 by Ryan J Ollos, 8 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, 8 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, 8 years ago

Owner: set to Ryan J Ollos
Status: newassigned

comment:4 by Ryan J Ollos, 7 years ago

Release Notes: modified (diff)

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

comment:5 by Ryan J Ollos, 7 years ago

API Changes: modified (diff)
Release Notes: modified (diff)

comment:6 by Ryan J Ollos, 7 years ago

Resolution: fixed
Status: assignedclosed

Committed to trunk in [13405].

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.