Skip to content

Instantly share code, notes, and snippets.

View gregg-cbs's full-sized avatar

gregg-cbs gregg-cbs

  • Cold Brew Studios
View GitHub Profile
@jerodfritz
jerodfritz / isOwners.js
Last active October 9, 2023 14:21
Strapi isOwners.js policy
'use strict';
/**
* `isOwners` policy that allows for many owners and a private field == false individual querying or sharing with multiple users as readonly
*/
const _ = require('lodash');
let compareIDs = (a, b) => {
return a.toString() === b.toString();
}
@jerodfritz
jerodfritz / isOwner.js
Created October 26, 2021 14:08
Strapi isOwners.js policy
'use strict';
/**
* `isOwner` policy.
*/
var pluralize = require('pluralize')
module.exports = async (ctx, next) => {
try {
let errMsg = "You are not allowed to perform this action.";
@buddalee
buddalee / nextjs-device-detect.js
Created May 27, 2020 06:36
Nextjs in server side to detect device with user agent
Nextjs in server side to detect device with user agent