Skip to content

Fix: prevent requesters from approving own reservations - #93

Merged
Rom1-B merged 2 commits into
11.0/bugfixesfrom
issue_68
Nov 17, 2026
Merged

Rom1-B merged 2 commits into
11.0/bugfixesfrom
issue_68

Conversation

@Rom1-B

@Rom1-B Rom1-B commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Checklist before requesting a review

Please delete options that are not relevant.

  • I have performed a self-review of my code.
  • I have added tests (when available) that prove my fix is effective or that my feature works.
  • I have updated the CHANGELOG with a short functional description of the fix or new feature.
  • This change requires a documentation update.

Description

  • It fixes Issue with material reservation approval #68
  • Any requester, including self-service users on the simplified interface, could approve or refuse their own reservation request from the ticket timeline, as long as the ticket had no followup or task yet.
  • Answering a reservation request now requires the standard interface and the right to create reservations for other users, so only actual validators see and can use the approve/refuse actions.

Screenshots (if appropriate):

@Rom1-B Rom1-B mentioned this pull request Nov 16, 2026
2 tasks done
@Rom1-B Rom1-B linked an issue Nov 16, 2026 that may be closed by this pull request
2 tasks done
@Rom1-B
Rom1-B requested review from a team, Mary-Clb, MyvTsv and RomainLvr and removed request for a team November 16, 2026 12:57
Comment thread src/Model/TicketReservationRequest.php Outdated
Comment on lines +271 to +272
// Answering is a validator action: the requester (who passes canUpdateItem() on a fresh ticket)
// must not approve their own request, so require the right core asks to reserve on behalf of others.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment is confusing: a technician can still see the Approve/Refuse actions on their own request and approve it (reproduced on a local instance with the default tech user and Technician profile).

@Rom1-B
Rom1-B requested a review from Mary-Clb November 16, 2026 14:45
@Rom1-B
Rom1-B merged commit b0fe8cf into 11.0/bugfixes Nov 17, 2026
7 checks passed
@Rom1-B
Rom1-B deleted the issue_68 branch November 17, 2026 09:23
@glpi-project

glpi-project Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Backport-action backported this pull request in workflow run 44055178769.

Target Status
main ✅ Created #94

Rom1-B added a commit that referenced this pull request Nov 17, 2026
Forward-port of #93 to `main`.

## Checklist before requesting a review

*Please delete options that are not relevant.*

- [x] I have performed a self-review of my code.
- [x] I have added tests (when available) that prove my fix is effective
or that my feature works.
- [x] I have updated the CHANGELOG with a short functional description
of the fix or new feature.
- [ ] This change requires a documentation update.

## Description

- It fixes #68
- Any requester, including self-service users on the simplified
interface, could approve or refuse their own reservation request from
the ticket timeline, as long as the ticket had no followup or task yet.
- Answering a reservation request now requires the standard interface
and the right to create reservations for other users, so only actual
validators see and can use the approve/refuse actions.

## Screenshots (if appropriate):

Co-authored-by: Romain B. <8530352+Rom1-B@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue with material reservation approval

3 participants