What is the best way to separate the whole site depending on roles? I would like to implement a membership site with three roles: basic, silver and gold membership. The site content should depend on these memberships. There are different content types e.g. Tutorial and views and search api are used to list and search for content. A basic member should be able to list all Tutorial contents. But when opening one only a limited preview containing only a subset of all fields of this content type should be shown. A silver member should be able to view the whole content, all fields should be listed. In the view the lists the content also a limited teaser should be shown. This means also the view should list the content depending on the membership.
My approach is to use different roles for the memberships and to use different view modes for the content types for the different roles : view-mode-basic, view-mode-silver, view-mode-gold. But I don't know how to show content using a different view mode depending on the users role. Same for views. For views I also thought about using differnt path and to use Rules to redirect based on the user role, e.g. /list-teaser-basic and /list-teaser-silver.
Has anyone done something similar before and can give me some guidance on the correct approach?
The Group module allows for creating arbitrary collections of your content and users on your site, and grant access control permissions on those collections. It is designed to be an alternative to Organic Groups. The Group module creates groups as entities, making them fully fieldable, extensible and exportable.
For this specific question, you'd enable the
gnode submodule, and for each group type you would define the appropriate permissions (view, edit, delete, etc) for the various Content Types. That's it. Refer to my answer to "Group module with advanced permissions based on taxonomy (preferrably)", which includes a sample configuration.
For more details about the various types of roles used by the Group module, refer to my answer to "What are the various roles supported by the Group module?".