Hi, 
The djblets code that checks the permissions and fetching the object for 
repository id: 1 is in djblets/webapi/resources.py:WebApiResource's get 
method. If you put a breakpoint inside of that method and try running 
http://<server>/api/repositories/1/, it should stop at that point, and you 
can check where it fails. The actual method where the permission is checked 
for repositories (this is called from within the above method) is in 
reviewboard.scmtools.models.Repository's is_accessible_by method. Its 
probably better to breakpoint here rather than the WebApiResource as the 
latter is called in more places.

Regards
Raja

On Tuesday, February 12, 2013 10:42:59 PM UTC+5:30, Liam Reimers wrote:
>
> I investigated this a bit further. I see that RB does indeed authenticate 
> against the LDAP server, and a cookie file is created with an rbsessionid 
> and an expiration time (?) one year in the future. Do you have any hints 
> for me on where to look for the code that checks the permissions and how I 
> might trace through it?
>
> On Friday, February 8, 2013 2:07:09 PM UTC-8, Liam Reimers wrote:
>>
>> Just this:
>>
>> 2013-02-07 22:44:04,478 - DEBUG - Attempting authentication on API for 
>> user <user>
>>
>> On Friday, February 8, 2013 12:14:44 PM UTC-8, Christian Hammond wrote:
>>>
>>> This has come up on occasion with LDAP, but we've never been able to 
>>> track down the cause.
>>>
>>> Can you check your reviewboard.log file for any messages around the time 
>>> of a post?
>>>
>>> Christian
>>>
>>>
>>> On Feb 8, 2013, at 10:14, Liam Reimers <liam.r...@gmail.com> wrote:
>>>
>>> This user is Staff and Admin, but is an LDAP user. User can authenticate 
>>> to the web pages and perform all actions there.
>>>
>>> He cannot use the post-review client to post a review, getting HTTP/403, 
>>> API/101:
>>>
>>> % post-review --debug -o
>>>
>>> >>> RBTools 0.4.3
>>> >>> Python 2.7.2 (default, Oct 11 2012, 20:14:37) 
>>> [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)]
>>> >>> Running on Darwin-12.3.0-x86_64-i386-64bit
>>> >>> Home = <homedir>
>>> >>> Current Directory = <currdir>
>>> >>> Checking the repository type. Errors shown below are mostly harmless.
>>> DEBUG:root:Checking for a Bazaar repository...
>>> DEBUG:root:Checking for a CVS repository...
>>> DEBUG:root:Checking for a ClearCase repository...
>>> DEBUG:root:Checking for a Git repository...
>>> DEBUG:root:Running: git rev-parse --git-dir
>>> DEBUG:root:Command exited with rc 128: ['git', 'rev-parse', '--git-dir']
>>> fatal: Not a git repository (or any parent up to mount point 
>>> /Volumes/local_data)
>>> Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not 
>>> set).
>>> ---
>>> DEBUG:root:Checking for a Mercurial repository...
>>> DEBUG:root:Running: hg showconfig
>>> DEBUG:root:Running: hg root
>>> DEBUG:root:Command exited with rc 255: ['hg', 'root']
>>> abort: There is no Mercurial repository here (.hg not found)!
>>> ---
>>> DEBUG:root:Checking for a Perforce repository...
>>> DEBUG:root:Checking for a Plastic repository...
>>> DEBUG:root:Checking for a Subversion repository...
>>> DEBUG:root:Running: svn info
>>> DEBUG:root:Running: diff --version
>>> DEBUG:root:repository info: Path: svn+ssh://<repo>, Base 
>>> path:<repopath>, Supports changesets: False
>>> >>> Finished checking the repository type.
>>> DEBUG:root:Running: svn propget reviewboard:url <currdir>
>>> >>> HTTP GETting api/info/
>>> DEBUG:root:Running: svn diff --diff-cmd=diff
>>> DEBUG:root:Running: svn info .
>>>
>>> <more debug about svn info all the files>
>>>
>>> >>> HTTP GETting api/
>>> >>> HTTP GETting https://<server>/api/info/
>>> >>> Using the new web API
>>> >>> HTTP GETting https://<server>/api/repositories/
>>> >>> HTTP GETting https://<server>/api/repositories/1/
>>> >>> Got API Error 101 (HTTP code 403): You don't have permission for this
>>> >>> Error data: {u'stat': u'fail', u'err': {u'msg': u"You don't have 
>>> permission for this", u'code': 101}}
>>> Error creating review request: You don't have permission for this (HTTP 
>>> 403, API Error 101)
>>>
>>> -- 
>>> Want to help the Review Board project? Donate today at 
>>> http://www.reviewboard.org/donate/
>>> Happy user? Let us know at http://www.reviewboard.org/users/
>>> -~----------~----~----~----~------~----~------~--~---
>>> To unsubscribe from this group, send email to 
>>> reviewboard...@googlegroups.com
>>> For more options, visit this group at 
>>> http://groups.google.com/group/reviewboard?hl=en
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "reviewboard" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to reviewboard...@googlegroups.com.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>  
>>>  
>>>
>>>

-- 
Want to help the Review Board project? Donate today at 
http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users/
-~----------~----~----~----~------~----~------~--~---
To unsubscribe from this group, send email to 
reviewboard+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to