The project owner at https://www.drupal.org/node/2208431/maintainers has the "administer releases" permission not checked but can roll releases (which is ok because it comes with being a project owner). tvn told me to open an issue so that this can get investigated later.

Comments

dddave’s picture

Title: Project owner able to role releases but "Administer releases" permission not checked » Project owner able to roll releases but "Administer releases" permission not checked
drumm’s picture

Project: Drupal.org customizations » Project
Version: 7.x-3.x-dev » 7.x-2.x-dev
Component: User interface » Releases
Issue tags: +drupal.org hitlist

That checkbox probably appeared when releases were enabled as the sandbox project was promoted. Project/project_release can either:

  • Make sure it gets checked when releases are enabled.
  • Show it as checked anyway.
avpaderno’s picture

Given the code used for the access callback for node/add/project-release/%project, this is by design, when it happens to the node owner.

function project_user_access($project, $permission, $account = NULL) {
  global $user;

  if ($account == NULL) {
    $account = $user;
  }

  if (empty($account->uid)) {
    return FALSE;
  }

  $project_obj = is_numeric($project) ? node_load($project) : $project;
  if (!isset($project_obj) || (isset($project_obj->type) && !project_node_is_project($project_obj))) {
    return FALSE;
  }

  // If the user has the site-wide admin permission, always grant access.
  if (user_access('administer projects')) {
    return TRUE;
  }

  // Project owners are treated as super users and can always access.
  if ($account->uid == $project_obj->uid) {
    return TRUE;
  }

  // Otherwise, see if the user has the right permission for this project.
  return !empty($project_obj->project['maintainers'][$account->uid]['permissions'][$permission]);
}

Project owners are treated as super users and have any permission passed to the access callback. It makes more sense to always show the permission checkboxes as selected, for the node owner.

avpaderno’s picture

Status: Active » Needs review
StatusFileSize
new906 bytes

  • drumm committed 3be66ab on 7.x-2.x authored by kiamlaluno
    Issue #2536928 by kiamlaluno: Project owner able to roll releases but "...
drumm’s picture

Status: Needs review » Fixed

Thanks, this has been deployed to Drupal.org.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.