How to publish and unpublish content depending on the type of user? I have a site with content for two different user types: primary and secondary. I want to publish and unpublish some content depending on whether the current user is anonymous user, user primary or secondary user.

If the current user is an anonymous user:


to publish primaria/docentes
to publish secundaria/docentes
to unpublish primaria/docentes/kit
to unpublish secundaria/docentes/kit


If the current user is a primary user:


to unpublish primaria/docentes
to publish primaria/docentes/kit


If the current user is a secondary user:


to unpublish secundaria/docentes
to publish secundaria/docentes/kit


I try to do this with the the Rules module. The result of my configuration is this:
 - In the computer 1, I login as a primary user. Everything works fine.
 - In the computer 2, I login as a secondary user. Everything works fine.
 - If I return to the computer 1, the things are not good. I see that everything works as if logged in as a secondary user.

My settings do not respect the rules for the user already logged on. Every time someone logs on to any part of the world, that user settings apply to all other users in the world.

Please help me. I attached screenshots of my settings. :(

All my rules: 

Log in as an anonymous user.

When primary user logs.

When primary user logs off.
Publishing and unpublishing is not the way to go.

Step 1) 

Install the Node Access module and give access to each node or content type accordingly, this way people can't share direct links with other users that have a different role. 

Step 2)

What you need is to create 3 different view blocks

One for anonymous which lists primaria/docentes &amp; secundaria/docentes nodes.

One for primary which lists all the primaria/docentes nodes

One for secondary which lists all the secundaria/docentes/kit nodes. 


  Hopefully node access module lets you filter your view by node access.
  Otherwise, you'll need to make the "kit", "primaria" and "secundaria"
  be a different content types so then you can filter by content type in
  your view.


Use view's access to role and select the role you want to be able to see the view. (see picture below)



Then you place all 3 view blocks wherever you need them (home page perhaps?) and since you have the view access by role, they will only see 1 view (the one they have access to).