1

At my Drupal 7 site every registred user can add nodes. But sometimes i'd like to put some users to group e.g. "Temp ban" and block node add/edit for this users/group.

How can I do it?

okolobaxa
  • 338
  • 1
  • 4
  • 16

3 Answers3

1

Add another role.
Deny this role the ability to add nodes (or whatever it is you want to deny them).
Change users role to this new role.

Edit
Create a small module that implements hook_menu_alter to alter the 'access callback' of the paths you want, then in your custom access callback function, return true for the roles you want and false for the roles you don't want'.

2pha
  • 9,798
  • 2
  • 29
  • 43
  • Permissions for my "temp ban" role as inheritances from "registered user" build-in role, so I can't simple "deselect" permission "add node". – okolobaxa Dec 21 '16 at 08:32
1

You have a lot of modules contrib for rights and access :

https://www.drupal.org/project/block_access

https://www.drupal.org/project/og

Also you have custom way :

https://drupal.stackexchange.com/questions/69861/how-do-i-programmatically-assign-the-access-to-a-block

Community
  • 1
  • 1
Fky
  • 2,133
  • 1
  • 15
  • 23
0

Module Deny Access is what I was looking for.

okolobaxa
  • 338
  • 1
  • 4
  • 16