Access Control Snippets

Title Categories Createdsort ascending

Restrict webform components by role

by mordonez
View restrict webform components by role
php
  1. /**
  2.  * Alter the list of available Webform components.
  3. ...
Access Control
for Drupal 7

snippet rating: 0

1 week 2 days ago

Only allow posts by users with accounts more than two days old.

by paulbooker
Access Control
for Drupal 7

snippet rating: 0

1 month 18 hours ago

Restrict the site access through http password authentication

by nvl.sateesh
Access Control, Administration, User Management, Utility
for Drupal 7

snippet rating: 1

1 month 4 days ago

Make a menu access to logged in users only

by ooops
View make a menu access to logged in users only
php
  1. // Replace your menu path with "your_menu_path"
  2. function mymodulename_menu_alter(&$items...
Access Control
for Drupal 7

snippet rating: -1

comments: 4

1 month 1 week ago

Copy permissions from one role to another using Mysql only

by lmdoom
View copy permissions from one role to another using mysql only
sql
  1. CREATE TEMPORARY TABLE tmp SELECT * FROM role_permission WHERE rid...
Access Control, Database/SQL
for Drupal 7

snippet rating: 2

1 month 3 weeks ago

user_has_role()

by alexweber
View user_has_role()
php
  1. /**
  2.  * Determine whether a user has a particular role.
  3.  * Accepts both the...
Access Control, User Management
for Drupal 7

snippet rating: 0

comments: 2

2 months 4 days ago

Check if user has certain role

by pari
View check if user has certain role
php
  1. if (array_intersect(array('administrator','editor'), array_values...
Access Control
for Drupal 5, 6, 7, 8

snippet rating: 2

2 months 3 weeks ago

To prompt user to rebuild node access permissions table after enabling a module

by Bobita4u
View to prompt user to rebuild node access permissions table after enabling a module
php
  1. function user_relationship_node_access_enable() {
  2. node_access_needs_rebuild...
Access Control
for Drupal 6, 7

snippet rating: -1

2 months 3 weeks ago

Reset the Drupal 7 administrator password

by timonweb
View reset the drupal 7 administrator password
php
  1. <?php
  2. define('DRUPAL_ROOT', getcwd(...
Access Control, Administration
for Drupal 7

snippet rating: 0

comments: 2

4 months 1 week ago
Subscribe to Access Control Snippets