#11049 closed enhancement (fixed)
Questions about licensing and some suggested refactoring
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Component: | PrivateReportsPlugin |
Severity: | normal | Keywords: | license refactoring |
Cc: | Trac Release: |
Description
May I suggest a few changes (which I'm happy to push myself given approval from the author)?
- License:
- Clarify which of the GPL licenses is used. Better yet, would you consider changing the license of this plugin and your other plugins (PrivateCommentPlugin and HideableQueryPlugin) to BSD 3-Clause, which is what the Trac core uses, and what I consider to be the most "friendly" license for Trac development? :)
- Add text of the license in a
COPYING
file. - Add license headers to each file.
- Code:
- Change tabs to spaces source files (per the PEP-008 recommendation). The template contains a mix of tabs and spaces.
- As in [12959], we don't have to close the cursor, and as in [12958] it isn't necessary to print the SQL statements to the debug log since the Trac API handles this.
- As in [12960], we can get the report id from the request args and simplify the code in
pre_process_request
.reg.args.get('id')
will return the ID number when on the/report/id
page, and will returnNone
when on the/report
page. Actually, you do something very similar inrender_admin_panel
. - Allow a user with
REPORT_ADMIN
andPERMISSION_ADMIN
to grant/revoke permissions for a report, as opposed to requiringTRAC_ADMIN
.
I haven't thought about this for too long, so maybe I'm overlooking the obvious, but what is the use-case for having admin-defined custom permissions for each report as opposed to just generating a VIEW
permission for each report that exists REPORT_VIEW_1
, REPORT_VIEW_2
, ...? Making this change could eliminate the need for the admin panel. I don't think we'd even need a database table, since all of the permissions could be generated in IPermissionRequestion.get_permission_actions
, given the existing report numbers.
Actually, all of this can be done anyway with t:TracFineGrainedPermissions (the accuracy of that statement should be checked given the existence of defects such as t:#11069), so maybe the plugin should just be a nicer interface to editing an authz file for reports? There is currently a FineGrainedPageAuthzEditorPlugin that we plan to integrate into AccountManagerPlugin in #9947. A friendly interface to the authz file could allow a user to make specific reports private without requiring a specialized plugin.
Attachments (0)
Change History (21)
comment:1 Changed 12 years ago by
Keywords: | license refactoring added |
---|
comment:2 Changed 12 years ago by
comment:3 Changed 12 years ago by
You may implement the things mentioned. Also I'm ok with the BSD license. At the moment I don't really have time for trac so having another maintainer would be nice. The reason why I made this is that I didn't find a simple way to hide reports at that point in time. The plugin you mentioned looks good by the way.
comment:4 Changed 12 years ago by
Owner: | changed from Michael Henke to Ryan J Ollos |
---|---|
Status: | new → assigned |
comment:5 Changed 12 years ago by
comment:6 Changed 12 years ago by
comment:8 Changed 12 years ago by
comment:10 Changed 12 years ago by
comment:11 Changed 12 years ago by
comment:12 Changed 12 years ago by
comment:13 Changed 12 years ago by
Replying to rjollos:
Actually, all of this can be done anyway with t:TracFineGrainedPermissions (the accuracy of that statement should be checked given the existence of defects such as t:#11069), so maybe the plugin should just be a nicer interface to editing an authz file for reports? There is currently a FineGrainedPageAuthzEditorPlugin that we plan to integrate into AccountManagerPlugin in #9947. A friendly interface to the authz file could allow a user to make specific reports private without requiring a specialized plugin.
I've captured these ideas here.
comment:14 Changed 12 years ago by
comment:18 Changed 12 years ago by
comment:19 Changed 12 years ago by
Screen capture on project wiki page has been updated to reflect changes in this ticket: wiki:PrivateReportsPlugin:PrivateReportAdmin-Trac1.0.png
comment:20 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:21 Changed 12 years ago by
(In [13050]) Fixes #11052, Refs #11049: (PrivateCommentPlugin)
- Changed license to BSD 3-Clause with permission of author.
- Changed plugin name to CamelCase.
If/while implementing these changes, we'll want to compare against the changes made in [12958:12960] for the PrivateCommentPlugin. I should have done a better job of separating out the tabs -> spaces changes into a single changeset that could be ignored for the purpose of code review.