Skip to content

Commit

Permalink
refactor(social-media): dummy permissions added for Social Media
Browse files Browse the repository at this point in the history
  • Loading branch information
nirmalhk7 committed Apr 29, 2021
1 parent 4686c41 commit dc99f17
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"develop": "strapi develop",
"start": "strapi start",
"build": "echo $LICENSE> license.txt && strapi build",
"build:dev": "strapi build",
"strapi": "strapi"
},
"dependencies": {
Expand Down
9 changes: 9 additions & 0 deletions plugins/social-media/admin/src/permissions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const pluginPermissions = {
// This permission regards the main component (App) and is used to tell
// If the plugin link should be displayed in the menu
// And also if the plugin is accessible. This use case is found when a user types the url of the
// plugin directly in the browser
main: [{ action: "plugins::social-media.read", subject: null }],
};

export default pluginPermissions;
17 changes: 17 additions & 0 deletions plugins/social-media/config/functions/bootstrap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = async () => {
// set plugin store
registerPermissionActions();
};
const registerPermissionActions = () => {
const actions = [
{
section: "plugins",
displayName: "Access Plugin",
uid: "read",
pluginName: "social-media",
},
];

const { actionProvider } = strapi.admin.services.permission;
actionProvider.register(actions);
};

0 comments on commit dc99f17

Please sign in to comment.