-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(social-media): dummy permissions added for Social Media
- Loading branch information
Showing
3 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}; |