mautic / mautic/api-library

Code 500 during API connecting for users without full permissions

Open
#243 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
205
Forks
129
PR merge metrics
No merged PRs in 30d

Description

Hello,
where I send POST API to Mautic for users without full permissions Mautic give me code 500 and this log:
[2021-03-31 16:06:52] mautic.CRITICAL: Uncaught PHP Exception Mautic\CoreBundle\Security\Exception\PermissionNotFoundException: "Nie znaleziono zgody. 'lead:leads:newown' given." at /var/www/mautic/app/bundles/CoreBundle/Security/Permissions/CorePermissions.php line 292 {"exception":"[object] (Mautic\\CoreBundle\\Security\\Exception\\PermissionNotFoundException(code: 403): Nie znaleziono zgody. 'lead:leads:newown' given. at /var/www/mautic/app/bundles/CoreBundle/Security/Permissions/CorePermissions.php:292)"} []

Even if you select all possible options for user in "Role", the problem occurs. It disappears only when I select "full permissions" or give user administrator access.
image

Mautic 3.3.2
PHP 7.4.3


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing a POST API request with a user who lacks full permissions, using the Mautic 3.3.2 and PHP 7.4.3 context in the report. Read app/bundles/CoreBundle/Security/Permissions/CorePermissions.php around line 292 and trace the lead:leads:newown permission lookup. Done means the request no longer returns HTTP 500 for the described restricted role while permission checks remain enforced.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, authorization, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.