Re: [viewvc-dev] ViewVC 1.1

"Phil Pinkerton" <[email protected]>
Newsgroups gmane.comp.version-control.cvs.viewcvs.devel
Message-ID <c70ccaee0803190448m6a329964m3fd5bb097938791a__37681.7845427015$1205927355$gmane$org@mail.gmail.com>
On Tue, Mar 18, 2008 at 5:10 PM, C. Michael Pilato <[email protected]>
wrote:

> C. Michael Pilato wrote:
> > Phil Pinkerton wrote:
> >>>     As far as I know, it works fine today.  You do have to remember
> >>> to set
> >>>     authorizer=forbiddenre, of course.
> >>
> >> yes I did  and I just changed the code in
> >>
> >> vcauth/forbiddenre/__init__.py
> >>
> >> and now it is working
> >>
> >> what I changed was every instance of forbidden I changed to
> >> forbiddenre in the py code.
> >
> > You must have been doing something wrong, because the code today works
> > as expected.  (I have confirmed as much.)  But no matter, I'll change it
> > so that the config line is forbiddenre= because that will be helpful to
> > folks upgrading.
> >
>
> Committed in r1836.  Thanks, Phil, for this valuable feedback and your
> willingness to test unreleased code.
>
> --
> C. Michael Pilato <[email protected]>
> CollabNet   <>   www.collab.net   <>   Distributed Development On Demand
>
>
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={}):
    forbidden = params.get('forbidden', '')
    self.forbidden = map(lambda x: _split_regexp(string.strip(x)),
                         filter(None, string.split(forbidden, ',')))

  def _check_root_path_access(self, root_path):
    default = 1
    for forbidden, negated in self.forbidden:
      if negated:
        default = 0
        if forbidden.search(root_path):
          return 1
      elif forbidden.search(root_path):
        return 0
    return default
snip ...


-- 
" 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.