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 18, 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 3 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".

  • TBD - support_expire (a.k.a "Support team").
  • When user creates a VSite they get the "vsite admin" role.

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