Skip to content

Commit

Permalink
update post route permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
stepanjakl committed May 30, 2024
1 parent fae3a1f commit 71e403a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,9 @@ Once set up, run tests using `npm run tests` to validate any changes before depl

<br>

## TODOs (Limitations)
## TODOs (Improvements)

- fix disappering `stripeProductObject` and `stripePriceObject` data when moved between `draft` and `published` modes and vice versa
- optional product piece type REST API or configurable schema fields
- automatic synchronization on product catalog changes with global schema field to enable
- two-way synchronization between ApostropheCMS and Stripe
4 changes: 1 addition & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,7 @@ module.exports = {
}
}

if (req.user && (req.user.role === 'editor' || req.user.role === 'admin')) {

/* TODO req.user && (req.user._permissions || {}) */
if (req.user && self.apos.permission.can(req, 'create', 'stripe-products/product')) {

let jobResolve, reporting;
const jobPromise = new Promise((resolve, reject) => {
Expand Down
4 changes: 4 additions & 0 deletions modules/stripe-products/product/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,15 @@ module.exports = {
batchOperations: {
remove: [ 'publish' ]
},
icons: {
sync: 'Sync'
},
utilityOperations(self) {
return {
add: {
synchronizeProducts: {
label: 'stripeProducts:synchronizeProducts',
icon: 'sync',
canEdit: true,
button: true,
eventOptions: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stepanjakl/apostrophe-stripe-products",
"version": "0.0.7",
"version": "0.0.8",
"description": "Stripe Products For ApostropheCMS",
"keywords": [
"apostrophe",
Expand Down

0 comments on commit 71e403a

Please sign in to comment.