2

We use Drupal as the basis for a student information website. We have 3 intakes of students a year and I would like to be able to allocate students various rights based on roles, primarily if they are

  • a current student,
  • an applying student,
  • or an alumni.

But I would also like to be able to identify them by what class they did.

  • Should I create a new role for each new intake?
  • Should I use groups?
  • Is there an alternative method I should use?
8
  • It also depends on what rights you would like to allocate them. But basically, I think you could examine rights if a student has a role AND another, then he/she has the right to do something - e.g. IF he is a current student AND goes to the second class, THEN he/she can participate in.... etc.
    – Sk8erPeter
    Commented Apr 18, 2012 at 0:42
  • But these don't necessarily have to be roles: the beginning and the end of the studies are known data. From these data, other conditions can also be calculated. OR these roles could even be updated periodically (yearly).
    – Sk8erPeter
    Commented Apr 18, 2012 at 0:49
  • @Sk8erPeter I'm afraid your not making much sense, and could you please delete your comments and make them an answer?
    – Toby Allen
    Commented Apr 18, 2012 at 15:49
  • I'm afraid your not making much sense - really BIG thanks for saying this after I'm trying to help you... :D I referred to writing a simple module to restrict access depending on roles as a user can have multiple roles (e.g. "currently student" role AND "goes to second class" role, etc.) - or depending on the beginning year of the studies, you can calculate if someone is still a student or not, etc. BUT if you don't understand what someone is trying to say, you could ASK instead of insulting him/her with saying his words don't make any sense at all, especially when he/she tries to help you.
    – Sk8erPeter
    Commented Apr 18, 2012 at 16:30
  • @Sk8erPeter you should post your comments as an answer and let others decide if you are making sense.
    – Toby Allen
    Commented Apr 18, 2012 at 17:36

3 Answers 3

2

Best and simple way is to assigning Roles.

Users, roles and permissions

2
  • 1
    Is the roles system designed to have 10's or 100's of Roles?
    – Toby Allen
    Commented Apr 18, 2012 at 15:51
  • 1
    Yes. But there will be some design mess of course.
    – niksmac
    Commented Apr 18, 2012 at 15:52
2

I'd probably initially set up the Current Student, Applying Student, and Alumni roles and get that out of the way.

I'd then have a content type called Class, and hold all of the class information you require in here. I'd then use the Entity Reference to create a link between each student, and any classes they take. This will allow you to filter quite easily in Views and such users based on classes.

Alternatively, if the classes are required to have communities (i.e. people from the Biology class have a place to post information etc) I suppose you could use Organic Groups and sign each student up to the relevent classes/groups.

If you need me to expand on anything or if this doesn't fit then please let me know in the comments and I'll see if I can help any more!

1

You could, for sure, use the Group module for this. Group allows for creating arbitrary collections of your content and users on your site, and grant access control permissions on those collections. It is available as of D7, and has a D8 version also. It is designed to be an alternative to Organic Groups. The Group module creates groups as entities, making them fully fieldable, extensible and exportable.

Some more details about the various roles used by the Group module:

  • Configured Global Roles: These roles can be configured via the admin interface of the Group module, they are available (to grant permissions) for all individual groups (regardless of the "Group Type"). These roles cannot have permissions that vary per group type (they are all the same). Typical examples of such roles could be "Group Moderator" or "Group Administrator".

  • Special Global Roles: These are the special (hardcoded) roles named "Outsider" (= a signed in user that did not join a group) and "Member" (= a signed in user that did join a group). These cannot be defined by the Drupal administrator, and they are always available for any group. Unlike Configured Global Roles, these roles can have different permissions sets for each group type. Special case: the role "Anonymous" is related to a user that is not signed).

  • Group Specific Roles: These roles can be configured per group type and will only be available on groups of that group type. As an example, for a group type like "Class", you could configure roles such as "Teacher", "Student", "Alumni", etc.

Integration with various modules

The Group module integrates with various other (popular) modules, including:

The beauty, IMO, of these integrations are that they are more or less out-of-the box (not dozens of extra modules needed to make those integrations work).

Resources

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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