This has always been the case AFAIK. Or in other words, it has never
been intended that the SVN authz file and the authz file for
fine-grained permissions should be merged.
> 2.) AFAICT fine grained permisson access
> (tracopt.perm.authz_policy.*=true) is not group aware (see #4224). In
> detail I found out that only anonyous and authenicated are recognised.
> All other groups in the authz file are simply ignored. This makes it
> very hard to use the fine grained permissions in a proper way.
That seems to be the case, yes. The authz_policy module is in need of a
rewrite.
> 3.) The worst thing is that Trac will obey non of the svn permissions
> given by the authz file that controls the svn access. Anybody with
> BROWSER_VIEW will now be able to browse the WHOLE source tree
> regardless what the svn auhtz defines. In my case I had to take away
> BROWSER_VIEW from all anonymous users (very irritating) just I have
> some private folders in the repo.
That's surprising. Did you set "[trac] authz_file" and "[trac]
autz_module_name" correctly in trac.ini? Do you use multiple
repositories? Are your repositories named the same in Trac and in the
authz file?
> The worrying thing really is that I wasn't aware of problem 3.) and
> only found out by accident. Such a change should have been anounced in
> BIG RED letters before the release
AFAIR, there has been no change in the configuration, only in the
implementation, so if it was working before, it should still be working
now. Except if I broke something, of course :)
> and the inability to assign
> permissions to groups (this worked before via authzgroups plugin)
> should have been a BLOCKER for 0.12.
This has been the case forever, and nobody has stepped up to provide a
fix. So if it hasn't been a blocker for previous releases, it wasn't for
0.12 either.
> Maybe I've just done the configuration wrong and all the above items
> can be handled (in that case I'm eager to learn how ;) ).
Not all, but some of it :)
-- Remy
Of course, if you give anonymous BROWSER_VIEW, he will be able to browse
files :)
You should remove BROWSER_VIEW (and also CHANGESET_VIEW, FILE_VIEW and
LOG_VIEW) from all users (including anonymous), as that overrides the
fine-grained permissions. The permissions are now granted by the authz
system directly.
This indeed seems to be a difference in behavior from 0.11. We should
probably document that. Actually, TracFineGrainedPermissions still
mentions the old system, so we should rewrite the whole section.
-- Remy
In fact, the SVN authz file will now give BROWSER_VIEW, FILE_VIEW,
CHANGESET_VIEW and LOG_VIEW based on the paths you configure. For
example, if you have:
[projects:/foo]
anonymous = r
Then anonymous will get BROWSER_VIEW and FILE_VIEW for all paths below
/foo. Also, it will get CHANGESET_VIEW and LOG_VIEW for all changesets
that contain at least one path below /foo, and when displaying those
changesets, it will only show the files below /foo
This should not be confused with the authz_policy.py permission policy,
which allows managing permissions to any Trac resource like wiki pages
and tickets. It has a configuration with similar syntax, but the analogy
more or less stops here.
So in your case: don't specify any of BROWSER_VIEW, FILE_VIEW,
CHANGESET_VIEW and LOG_VIEW in the "global" permissions ("trac-admin
permission" or the "Permissions" admin panel), configure your SVN authz
file to restrict access to SVN, and pass the file to Trac in [trac]
authz_file. Trac will then enforce the same restrictions as SVN.
Note that the names of your repositories must be the same in SVN and in
Trac.
-- Remy
Isn't that simply a problem with the ordering of policies?
What is your "[trac] permission_policies" setting?
Does it help to put AuthzSourcePolicy first?
-- Christian
Really?
> On the other hand, denying, e.g., anonymous, BROWSER_VIEW will lead to
> anonymous not being able to browse the source AT ALL. No matter what
> authz_file says (the authz_file is, again, simply ignored by Trac
> 0.12) Trac wouldn't know that anonymous users should get the "Browse
> Source" button or be able to access foo/Browser.
Well, I have this exact setup here, and it's been working fine for
weeks. Did you add AuthzSourcePolicy to [trac] permission_policies, as
instructed in... well, nowhere, actually, not even the API changes
document. Let me fix that...
Here you go:
http://trac.edgewall.org/wiki/TracUpgrade#Auhtzpermissionchecking
Oh, actually, it's hidden in the help text for [trac] authz_file, but
that's probably not acceptable :)
-- Remy
No, should be able to control access to the source for anonymous in your
authz file, like any other user.
> * Can you confirm that AuthzPolicy is obsoleted by AuthzSourcePolicy
> and therefore can be removed from permission_policies completely?
No, AuthzPolicy and AuthzSourcePolicy are two different things. The
former allows controlling access to any Trac resource (wiki, tickets,
...), while the other one allows enforcing the same access rules to the
repositories in Trac as you have in Subversion, by using the same authz
file.
-- Remy
If you use the AuthzSourcePolicy *first*(well, SvnAuthzSourcePolicy
would probably have been a less confusing name - even if there's no
source dependency to svn, the permission model it implements is the one
of svn), *then* give BROWSER_VIEW to anonymous with the default,
coarse-grained permission, then the Browse Repository button should be
visible... yet the access to non-authorized parts of the repositories
should still be properly denied (untested though, but that's how it
should work).
-- Christian
Yes, please open a ticket, it will serve as a reminder for me to check
the case of anonymous users. I remember checking all possible cases for
authenticated users, but I'm not sure anymore about anonymous.
Are you using "anonymous" in your authz file to set permissions for
anonymous, or "$anonymous"? The latter isn't supported yet, see:
http://trac.edgewall.org/ticket/8289.
-- Remy