Last active
April 20, 2016 18:28
-
-
Save shadcn/eba959589c8dc075fac132efbcf786e4 to your computer and use it in GitHub Desktop.
Progammatically assign permissions to users in Drupal 8
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
<?php | |
use Drupal\user\RoleInterface; | |
// Allow anonymous and authenticated users to access contact form. | |
user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, array('access site-wide contact form')); | |
user_role_grant_permissions(RoleInterface::AUTHENTICATED_ID, array('access site-wide contact form')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment