Open zar-wtag opened 4 years ago
StackOverflow uses a tier based permission model. See this page for the different tiers and permissions.
Having roles and different permissions for them is a basic Drupal thing. The one thing not available is the automatic switch between the roles.
This is based on the following documentations:
I'd keep things a bit simpler and only work with 5 roles:
Permissions can be configured at /admin/people/permissions
.
User
, we'll assign multiple roles to the userUser
and Commentator
, we'll assign multiple roles to the userTo implement the automatic promotion, we'll have to create a module with a hook. See this example module to get started.
To keep things simple (in a first version at least), I'd suggest to automatically promote users based on their actions. For example:
Drupal has the hook hook_entity_insert
or hook_ENTITY_TYPE_insert
which we can use to check if a user should be promoted.
Inside the hook, the following things should happen:
$user->addRole()
Background
Our Stackoverflow clone will need different kind of roles and permissions. At the moment we don't know exactly what Stackoverflow has and how we could implement that.
Goal
Investigate what kind of roles and permissions Stackoverflow uses and investigate how we could implement it in our project.
Acceptance