Ticket #9348 (closed enhancement: fixed)
Opened 2 years ago
Last modified 2 years ago
Authz does not handle titles with umlauts
| Reported by: | Bengt.Lueers@… | Owned by: | cboos |
|---|---|---|---|
| Priority: | high | Milestone: | 0.12 |
| Component: | general | Version: | |
| Severity: | normal | Keywords: | unicode authzpolicy |
| Cc: | leho@… | ||
| Release Notes: | |||
| API Changes: | |||
Description
Rules like this won't work:
[wiki:ProtokollFünf@4] @members = WIKI_VIEW * =
while rules like this will:
[wiki:ProtokollFuenf@4] @members = WIKI_VIEW * =
(Given that corresponding pages exist.)
Attachments
Change History
comment:1 Changed 2 years ago by rblank
- Milestone set to unscheduled
comment:2 Changed 2 years ago by lkraav <leho@…>
- Cc leho@… added
comment:3 follow-up: ↓ 4 Changed 2 years ago by cboos
- Keywords unicode authzpolicy added; utf8 authz FineGrainedPermissions removed
- Milestone changed from unscheduled to 0.12
- Owner set to cboos
- Priority changed from normal to high
The problem is that we simply don't convert the utf-8 str to unicode.
Would be wonderful to add unit-tests one day for the authzpolicy tickets ;-)
comment:4 in reply to: ↑ 3 ; follow-up: ↓ 6 Changed 2 years ago by rblank
Replying to cboos:
Would be wonderful to add unit-tests one day for the authzpolicy tickets ;-)
… in addition to refactoring the whole thing to simplify parsing and checking, and in the process, improve its performance. By using a few big regexes, for example.
comment:5 Changed 2 years ago by cboos
- Resolution set to fixed
- Status changed from new to closed
Fixed in r9710, doc updated in TracFineGrainedPermissions@18.
comment:6 in reply to: ↑ 4 ; follow-up: ↓ 7 Changed 2 years ago by cboos
Replying to rblank:
Replying to cboos:
Would be wonderful to add unit-tests one day for the authzpolicy tickets ;-)
… in addition to refactoring the whole thing to simplify parsing and checking, and in the process, improve its performance. By using a few big regexes, for example.
He, you were not supposed to be looking, today ;-)
While I was doing the fix, I thought that we could already speed it up by having a per-user cache (user → authz_permissions → expand_actions), filled progressively for each new user checked and invalidated at the next parse_authz. That would already make the thing more usable, without the need for a full rewrite.
comment:7 in reply to: ↑ 6 Changed 2 years ago by rblank
Replying to cboos:
That would already make the thing more usable, without the need for a full rewrite.
Note that I wrote "refactor", not "rewrite" ;-)
The reason I suggested a major refactoring is the experience gained from svn_authz.py. It turned out that it was simpler and more correct to just parse the file "by hand" and store it into an adequate data structure, rather than using ConfigParser and looking up in its sections. I suspect the same to be true for authz_policy.py.
Also, removing the logging statements may also improve performance.
comment:8 Changed 2 years ago by Bengt.Lueers@…
Works now, thanks.



I assume your authz file is utf-8 encoded?
This may be due to an issue with fnmatch, which is used by authz_policy.py.