Skip to content
This repository was archived by the owner on Mar 3, 2025. It is now read-only.

OpenScholar permissions

Shushu Inbar edited this page Feb 23, 2014 · 13 revisions

In OpenScholar there are two levels of permissions - site-wide permissions and VSite permissions. Site-wide permissions are like any Drupal site permissions, and controlled via admin/people/permissions.

VSite permissions are permissions defined per VSite via /cp/users/permissions. In the VSite permissions the permissions are separated into applications (not into modules, as in the site-wide permissions), and will show only the enabled applications in the VSite.

General permissions

The top section in the VSite permissions is the "General permissions" section, which is a duplication of parts of the site-wide permissions.

Each permission in this section overrides the same site-wide permission..

Even if one of them is enabled as site-wide, it will be disabled if it is not enabled in the Vsite (and vice verse).

Roles

There are 4 default site-wide roles that are in use in OpenScholar. Unfortunately, two roles has different site-wide name and VSite name:

  • "VSite admin" name in VSite level is "Administrator".
  • "VSite user" name in VSite level is "Basic member".

The third role is "Content editor", and the fourth role is "Support team".

Each role has its own default usage. As long as they are not being changed, this is how they being use:

  • "VSite admin" - full administration of the VSite. When creating a VSite the owner of it will automatically get this role.
  • "VSite user" - standard VSite user, who can read VSite content and create and manage their own content in the VSite, as well as edit and remove widgets in the layouts.
  • "Content editor" - user who can manage any content in the VSite.
  • "Support team" - special temporary role (details below).

Support team

The idea behind "Support team" role is to allow simple tool for supporting VSite owners. As a "Support team" the user can see any VSite (even private), and ask to become a supporter for this VSite. Once it does, the user gets permissions to do anything needed in the VSite for a limited period of time. After 3 days these privileges are being revoked automatically.

For developers

When developing for OpenScholar, and there is a need to add site-wide permission as a VSite permission, all you need to do is to implement "hook_og_permission()", add each permission, and add a special attribute "os_override" => TRUE. For example:

/**
 * Implements hook_og_permission().
 */
function vsite_og_permission() {
  return array(
    'administer boxes' => array(
      'title' => t('Administer boxes'),
      'os_override' => TRUE,
    ),
    'edit boxes' => array(
      'title' => t('Edit boxes'),
      'description' => t('Edit existing boxes.'),
      'os_override' => TRUE,
    ),
  );
}

Clone this wiki locally