Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
erp5 erp5
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Labels
    • Labels
  • Merge requests 140
    • Merge requests 140
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedi
  • erp5erp5
  • Merge requests
  • !2066

Open
Created Feb 26, 2025 by Xiaowu Zhang@xiaowu.zhangDeveloper
  • Report abuse
Report abuse

wip: erp5_test_result: fix Unauthorized error when access connector

  • Overview 7
  • Commits 1
  • Changes 1

We sometimes get Unauthorized error when user cancel test suite, which then trigger TestResult_annotateCommit

the raison is getDestination() return value even user has no permission, we should probably check permission instead

Node: activities-02
Failures: 4
User name: 'xxxxxx'
Uid: 7998010792602638657
Document: /nexedi/test_result_module/xxxxxxxx
Method: TestResult_annotateCommit
Arguments: ('canceled',)
Named Parameters: {}

Exception:
  Module Products.CMFActivity.ActivityTool, line 372, in __call__
    result = method(*self.args, **self.kw)
  Module Products.ERP5Type.patches.PythonScript, line 182, in __call__
    return self._orig_bindAndExec(args, kw, None)
  Module Shared.DC.Scripts.Bindings, line 372, in _bindAndExec
    return self._exec(bound_data, args, kw)
  Module Products.PythonScripts.PythonScript, line 349, in _exec
    result = function(*args, **kw)
  Module script, line 41, in TestResult_annotateCommit
   - <PythonScript at /nexedi/TestResult_annotateCommit used for /nexedi/test_result_module/xxxxxxxx>
   - Line 41
    connector = portal.restrictedTraverse(connector_url)
  Module OFS.Traversable, line 360, in restrictedTraverse
    return self.unrestrictedTraverse(path, default, restricted=True)
  Module OFS.Traversable, line 292, in unrestrictedTraverse
   - __traceback_info__: ([], 'lab.nexedi.xxx')
    next = guarded_getattr(obj, name)
Unauthorized: You are not allowed to access 'lab.nexedi.xxx' in this context

Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: fixbug
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7