mirror of
https://github.com/glenndehaan/unifi-voucher-site.git
synced 2026-05-09 08:25:29 +02:00
[PR #85] [MERGED] Add AUTH_OIDC_RESTRICT_VISIBILITY Feature #116
Labels
No labels
bug
enhancement
pull-request
question
question
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/unifi-voucher-site#116
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/glenndehaan/unifi-voucher-site/pull/85
Author: @bjoerrrrn
Created: 7/30/2025
Status: ✅ Merged
Merged: 7/30/2025
Merged by: @glenndehaan
Base:
master← Head:pr-cleanup📝 Commits (4)
6951b99Merging PIN_OIDC_USER_TO_OWN_DOMAIN System to PR-Branch62db3afCleanup code prior to pull request131f726Cleanup code prior to pull request0c9aeacUpdated to . Fixed bulk-print.ejs notes view. Updated details.ejs view with additional voucher metadata. Updated voucher.ejs notes view. Created notes.js utils for extracting voucher notes and metadata. Updated docker-compose.yml. Updated README.md. Implemented voucher note check for seperator misuse. Implemented new notes-metadata embed. Implemented new voucher filter within existing chain. Fixed notes sort to only filter on the notes not the metadata. Removed unused variable forward to voucher.ejs📊 Changes
8 files changed (+91 additions, -15 deletions)
View changed files
📝
README.md(+14 -2)📝
docker-compose.yml(+1 -0)📝
modules/variables.js(+1 -0)📝
server.js(+30 -5)📝
template/components/bulk-print.ejs(+2 -2)📝
template/components/details.ejs(+24 -4)📝
template/voucher.ejs(+2 -2)➕
utils/notes.js(+17 -0)📄 Description
This pull request introduces the
PIN_OIDC_USER_TO_OWN_DOMAINfeature, which restricts voucher visibility and assignment based on the authenticated OIDC user's email domain. When enabled, users can only see and manage vouchers associated with their own domain.Key Changes
When a voucher is created and the feature is enabled, the user's email domain (from OIDC) is appended to the voucher note, separated by
|||. If a note is already provided, it is combined with the domain.On the voucher overview page, if the feature is enabled, only vouchers with a note matching the user's domain (either as the whole note or after the
|||separator) are shown.The domain is extracted from the authenticated user's email address via OIDC.
If the feature is disabled, the application behaves as before, showing all vouchers.
Motivation
This feature is intended for multi-tenant environments where users from different organizations should only access vouchers relevant to their own domain, improving security and data separation.
Implementation Details
/voucherPOST route./vouchersGET route.PIN_OIDC_USER_TO_OWN_DOMAINvariable.Testing
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.