843 return true if op allowed, else false. |
843 return true if op allowed, else false. |
844 default is policy to use if no config given.''' |
844 default is policy to use if no config given.''' |
845 |
845 |
846 user = req.env.get('REMOTE_USER') |
846 user = req.env.get('REMOTE_USER') |
847 |
847 |
848 deny = self.repo.ui.config('web', 'deny_' + op, '') |
848 deny = self.repo.ui.configlist('web', 'deny_' + op) |
849 deny = deny.replace(',', ' ').split() |
|
850 |
|
851 if deny and (not user or deny == ['*'] or user in deny): |
849 if deny and (not user or deny == ['*'] or user in deny): |
852 return False |
850 return False |
853 |
851 |
854 allow = self.repo.ui.config('web', 'allow_' + op, '') |
852 allow = self.repo.ui.configlist('web', 'allow_' + op) |
855 allow = allow.replace(',', ' ').split() |
|
856 |
|
857 return (allow and (allow == ['*'] or user in allow)) or default |
853 return (allow and (allow == ['*'] or user in allow)) or default |
858 |
854 |
859 def do_unbundle(self, req): |
855 def do_unbundle(self, req): |
860 def bail(response, headers={}): |
856 def bail(response, headers={}): |
861 length = int(req.env['CONTENT_LENGTH']) |
857 length = int(req.env['CONTENT_LENGTH']) |