labels * array) there will be a small performance improvement as the * label doesn't need to be compared to and loaded from the * database anymore. */ public function _getItem($path, $constraints = array()); } interface VersioncontrolUserMapperInterface { /** * Map the author of the passed VersioncontrolOperation object to a Drupal * uid, or FALSE if no uid mapping could be made. * * @param VersioncontrolOperation $commit * The commit to be mapped. * @return mixed * Either a uid (int), or FALSE if the mapping failed. */ public function mapAuthor(VersioncontrolOperation $commit); /** * Map the committer of the passed VersioncontrolOperation object to a Drupal * uid, or FALSE if no uid mapping could be made. * * @param VersioncontrolOperation $commit * The commit to be mapped. * @return mixed * Either a uid (int), or FALSE if the mapping failed. */ public function mapCommitter(VersioncontrolOperation $commit); } interface VersioncontrolAuthHandlerInterface { public function setRepository(VersioncontrolRepository $repository); /** * Determine whether the specified user has any access at all to the * repository. * * @param int $uid * The uid of the Drupal user to be checked. * * @return bool * Boolean indicating access approved (TRUE) or denied (FALSE) */ public function authAccess($uid); /** * Determine whether the specified user has access to create new branches in * the repository. * * @param int $uid * The uid of the Drupal user to be checked. * * @return bool * Boolean indicating access approved (TRUE) or denied (FALSE) */ public function authBranchCreate($uid); /** * Determine whether the specified user has access to delete the specified * branch in the repository. * * @param int $uid * The uid of the Drupal user to be checked. * @param VersioncontrolBranch $branch * The VersioncontrolBranch object representing the branch against which * authorization checks should be made. * * @return bool * Boolean indicating access approved (TRUE) or denied (FALSE) */ public function authBranchDelete($uid, VersioncontrolBranch $branch); /** * Determine whether the specified user has access to write to the specified * branch in the repository. * * @param int $uid * The uid of the Drupal user to be checked. * @param VersioncontrolBranch $branch * The VersioncontrolBranch object representing the branch against which * authorization checks should be made. * * @return bool * Boolean indicating access approved (TRUE) or denied (FALSE) */ public function authBranchUpdate($uid, VersioncontrolBranch $branch); /** * Determine whether the specified user has access to create new tags in the * repository. * * @param int $uid * The uid of the Drupal user to be checked. * @return bool * Boolean indicating access approved (TRUE) or denied (FALSE) */ public function authTagCreate($uid); /** * Determine whether the specified user has access to delete the specified * tag in the repository. * * @param int $uid * The uid of the Drupal user to be checked. * @param VersioncontrolTag $tag * The VersioncontrolTag object representing the tag against which * authorization checks should be made. * * @return bool * Boolean indicating access approved (TRUE) or denied (FALSE) */ public function authTagDelete($uid, VersioncontrolTag $tag); /** * Determine whether the specified user has access to update or modify * the specified tag in the repository. * * @param int $uid * The uid of the Drupal user to be checked. * @param VersioncontrolTag $tag * The VersioncontrolTag object representing the tag against which * authorization checks should be made. * * @return bool * Boolean indicating access approved (TRUE) or denied (FALSE) */ public function authTagUpdate($uid, VersioncontrolTag $tag); /** * Retrieve any errors messages that have been enqueued during auth checking. * * Most of the authorization methods will enqueue messages to indicate the * reason for rejecting access. These messages may be useful for logging, or * to provide as feedback to the user. */ public function getErrorMessages(); }