0

I've created a views page (holding all users information) for role ONE. Now I would like to give permission to that role he can change status (active/blocked) without editing the other fields (email, phone, username etc.) of the users.

I tried with Editable Fields module but it doesn't provide "editable formatter" in Users views field so it won't work for user's built-in field.

Is there a way to do so?

0

As I mentioned in the question,

I would like to give permission to that role he can change status (active/blocked) without editing the other fields...

I've done it without giving permission (Administer users) to role ONE.

I had to do configurations between tree modules Flag, Views and Rules. I created new flag, get flag in views using relationship and the add two simple rules. That's all

Let me post the answer, may be someone will need in the future.

  • Above mentioned three modules should be enabled with their UIs.

Creating Flag

  • Go to /admin/structure/flags/add, create a new flag and choose User as Flag Type, example

  • After saving the Flag Type, fill next form like this, you may choose options as you like.

Creating Views

  • Now, create a views page/block as you like with showing Users category and your all fields you want to show and add a Relationship for the flag you just created (in my case it was "Block User").

  • Now, add a new field as Flag link in the views and add relationship if its already not and choose settings

  • Save the views

Creating Rule

We have to add to rules one for block the user and other for activate the user.

Block User

Activate User

There are same steps to activate users using rules. You just only to change event as "A user has been unflagged, under Block User", check the status as blocked instead of active and finally add action Unblock User instead of Block user.

All done...

Now, go to view the views you just created check if it works.

I hope it'll help someone.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.