Contents
On this page
Staff access - Plugixa PDF Vouchers for WooCommerce
Access to vouchers is controlled by ordinary WordPress capabilities. When the plugin is activated, administrators and WooCommerce shop managers get all of them. Other users see nothing until you give them access.
The capabilities
| Capability | Lets the user |
|---|---|
plugixa_pdfv_view |
Open the app, see the dashboard, the vouchers and their history. |
plugixa_pdfv_redeem |
Redeem a voucher at the counter. Separate from editing it. |
plugixa_pdfv_create |
Create voucher by hand, add PDF designs, and with Pro make bulk codes. |
plugixa_pdfv_edit |
Adjust balance, change the expiry date, Resend email, edit PDF designs. |
plugixa_pdfv_delete |
Void voucher, archive PDF designs. |
plugixa_pdfv_export |
Reports and CSV exports PRO. |
plugixa_pdfv_manage_settings |
The Settings screen, the setup wizard and, with Pro, the activity log. |
Anyone with at least one of these sees the Plugixa PDF Vouchers menu. Buttons a user may not use are hidden, and every action is checked again on the server, so hiding a button is never the only protection.
Administrators always hold all of them, even if another plugin removes one by mistake.
Give a user access
The plugin has no role screen of its own. Use any role editor plugin, or WP-CLI:
# A counter role that can look up and redeem vouchers, nothing else
wp role create voucher_counter "Voucher counter" --clone=subscriber
wp cap add voucher_counter plugixa_pdfv_view plugixa_pdfv_redeem view_admin_dashboard
# Keep shop managers out of the voucher settings
wp cap remove shop_manager plugixa_pdfv_manage_settings
WooCommerce sends users who cannot edit posts or manage the shop back to My Account when they
open wp-admin. view_admin_dashboard is the WooCommerce capability that lets such a user in, so
a counter role built from scratch needs it. The Pro Voucher staff role below does this for you.
You can also give the capabilities to one user rather than a role.
Suggested set-ups
| Who | Capabilities |
|---|---|
| Counter staff | view, redeem |
| Customer service | view, redeem, create, edit |
| Shop manager | all seven |
| Accountant | view, export |
The Voucher staff role (Pro)
Pro adds a ready-made Voucher staff role PRO holding only view and redeem, and a phone screen for it. With Pro, any user who can redeem is let into wp-admin, and a user who can redeem but not run the shop gets a Voucher scanner menu entry. Users with the Voucher staff role land on Scan to redeem when they log in. See Scan to redeem.
Counter staff and the code-guessing lock
Users who can redeem vouchers are trusted to look codes up all day: the checkout and balance check lock against guessing never applies to them. See Checkout and redemption.
For developers
plugixa_pdfv_user_canfilters every permission decision, with the action, the record and the user.plugixa_pdfv_capabilitiesfilters the capability map the admin app receives (it only hides controls; the server still checks).
See Hooks.
When the plugin is deleted with Delete all vouchers and their history when the plugin is
deleted ticked, every plugixa_pdfv_ capability is removed from roles and users. See
Privacy and uninstall.
Quick Links
Share