Created
October 19, 2018 17:44
-
-
Save DanLaufer/2994d976f9cd70057424e658666a0311 to your computer and use it in GitHub Desktop.
Bash - Drupal 8 - Script to add permissions for a role to a paragraph
This file contains hidden or 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
#!/usr/bin/env bash | |
# drushpap - drush paragraph-add-permission | |
# usage: ./scripts/drushpap <paragraph_machine_name> | |
# to view the list of current permissions and roles, type: lando drush role:list | |
if [ "$1" = "" ]; then | |
echo "Error: incorrect number of arguments." | |
echo " - The drushpap command takes 1 argument: the machine name of the paragraph. It then gives permission to authenticated users for create, delete, update, and view, and for anonymous users to view only." | |
echo " - For example: drushpap my_paragraph" | |
else | |
lando drush rap authenticated "create paragraph content $1,delete paragraph content $1,update paragraph content $1,view paragraph content $1" | |
lando drush rap anonymous "view paragraph content $1" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment