Re: [viewvc-dev] ViewVC 1.1

"Phil Pinkerton" <[email protected]>
Newsgroups gmane.comp.version-control.cvs.viewcvs.devel
Message-ID <c70ccaee0803191021g1e2971e2ncfa1db2c9a2d9a22__19638.9135475785$1205947323$gmane$org@mail.gmail.com>
Nope* I am not confused* the code should read as it does in the 2008319
nightly release:

class ViewVCAuthorizer(vcauth.GenericViewVCAuthorizer):
  """A simple regular-expression-based authorizer."""
  def __init__(self, username, params={}):
    *forbidden = params.get('forbiddenre', '') <------------------  NOT as
It was  in 2008318 below .*



On Wed, Mar 19, 2008 at 1:02 PM, C. Michael Pilato <[email protected]>
wrote:

> Phil Pinkerton wrote:
> > So what your saying is that for "__init_.py"  in
> > viewvc-1.1-dev-2008318/lib/vcauth/forbiddenre this is the correct code ?
> >
> > snip ....
> >
> > class ViewVCAuthorizer(vcauth.GenericViewVCAuthorizer):
> >   """A simple regular-expression-based authorizer."""
> >   def __init__(self, username, params={}):
> *XXXX >     forbidden = params.get('forbidden', '') -----> this code is
> WRONG.*
> >     self.forbidden = map(lambda x: _split_regexp(string.strip(x)),
> >                          filter(None, string.split(forbidden, ',')))
>
> That's exactly what I'm saying.  The code is looking for the configuration
> option named "forbidden" in the params dictionary.  That params dictionary
> is provided by the caller, who gets it from the
> lib/config.py:get_authorizer_params(), which basically just stuffs into
> params all the keys and values of configuration options found in the
> configuration section named [authz-AUTHORIZERNAME] (where AUTHORIZERNAME
> is
> the name of the Authorizer module, in this case, "forbiddenre".  So that
> code, plus a configuration like this:
>
>     [general]
>     ...
>     authorizer = forbiddenre
>     ...
>
>     [authz-forbiddenre]
>     forbidden = (some regexps)
>
> works exactly as expected.  It doesn't matter than the configuration
> option
> name (forbidden) doesn't match the name of the Authorizer (forbiddenre),
> or
> indeed that it *does* match the name of a configuration option associated
> with a different Authorizer (forbidden).
>
> Of course, yesterday, I changed this code so that now you need:
>
>     [authz-forbiddenre]
>     forbiddenre = (some regexps)
>
> in hopes that this will clear up user confusion which clearly already
> exists. :-)
>
> --
> C. Michael Pilato <[email protected]>
> CollabNet   <>   www.collab.net   <>   Distributed Development On Demand
>
>


-- 
" The fundamental principle here is that the justification for a physical
concept lies exclusively in its clear an unambiguous relation to the facts
it can be experienced" AE
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.