Opened 11 years ago
Closed 10 years ago
#11529 closed enhancement (fixed)
[authz_policy] authz_file should be defined using PathOption
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.1.4 |
Component: | general | Version: | 1.0-stable |
Severity: | normal | Keywords: | authzpolicy |
Cc: | Branch: | ||
Release Notes: |
Relative paths for the |
||
API Changes: | |||
Internal Changes: |
Description
The example in the documentation for AuthzPolicy shows:
[authz_policy] authz_file = conf/authzpolicy.conf
and authz_file
is defined:
authz_file = Option('authz_policy', 'authz_file', '', 'Location of authz policy configuration file.')
A relative path for authz_file
is resolved relative to the environment directory: branches/1.0-stable/tracopt/perm/authz_policy.py@12054:175-17#L166.
On the other hand, PathOption
resolves relative paths as relative to the directory of the trac.ini configuration file. It is probably reasonable to expect that authz_file
would be relative to the $env/conf
directory since it is a configuration file. This would also make the behavior consistent with [trac] authz_file
, which uses PathOption
.
$ grep -r "PathOption(" teo-rjollos.git/ --exclude-dir=.svn --exclude=config.py --exclude=*.pyc teo-rjollos.git/tracopt/versioncontrol/git/git_fs.py: projects_list = PathOption('git', 'projects_list', doc= teo-rjollos.git/tracopt/versioncontrol/git/git_fs.py: projects_base = PathOption('git', 'projects_base', doc= teo-rjollos.git/trac/env.py: shared_plugins_dir = PathOption('inherit', 'plugins_dir', '', teo-rjollos.git/trac/web/chrome.py: shared_templates_dir = PathOption('inherit', 'templates_dir', '', teo-rjollos.git/trac/web/chrome.py: shared_htdocs_dir = PathOption('inherit', 'htdocs_dir', '', teo-rjollos.git/trac/versioncontrol/svn_authz.py: authz_file = PathOption('trac', 'authz_file', '',
If the change is made, an environment upgrade step will be required to modify the value of authz_file
in trac.ini:
- Strip
conf/
when path begins withconf/
. - Transform other relative paths to absolute paths or prefix with
..
.
Attachments (0)
Change History (2)
comment:1 by , 10 years ago
Milestone: | next-dev-1.1.x → 1.1.4 |
---|---|
Owner: | set to |
Release Notes: | modified (diff) |
Status: | new → assigned |
comment:2 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Committed to trunk in [13741:13743].
Proposed changes in log:rjollos.git:t11529.