Files
github-api/jacoco/org.kohsuke.github/GHPermission.java.html
2021-06-02 11:09:28 -07:00

73 lines
3.6 KiB
HTML

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>GHPermission.java</title><link rel="stylesheet" href="../jacoco-resources/prettify.css" type="text/css"/><script type="text/javascript" src="../jacoco-resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">GitHub API for Java</a> &gt; <a href="index.source.html" class="el_package">org.kohsuke.github</a> &gt; <span class="el_source">GHPermission.java</span></div><h1>GHPermission.java</h1><pre class="source lang-java linenums">/*
* The MIT License
*
* Copyright 2016 CloudBees, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the &quot;Software&quot;), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.kohsuke.github;
import java.util.Locale;
/**
* Permission for a user in a repository.
*
* @see &lt;a href=&quot;https://developer.github.com/v3/repos/collaborators/#review-a-users-permission-level&quot;&gt;API&lt;/a&gt;
*/
<span class="fc" id="L34">class GHPermission {</span>
private String permission;
private GHUser user;
/**
* Gets permission.
*
* @return one of {@code admin}, {@code write}, {@code read}, or {@code none}
*/
public String getPermission() {
<span class="nc" id="L45"> return permission;</span>
}
/**
* Gets permission type.
*
* @return the permission type
*/
public GHPermissionType getPermissionType() {
<span class="fc" id="L54"> return Enum.valueOf(GHPermissionType.class, permission.toUpperCase(Locale.ENGLISH));</span>
}
/**
* Gets user.
*
* @return the user
*/
public GHUser getUser() {
<span class="nc" id="L63"> return user;</span>
}
void wrapUp(GitHub root) {
<span class="pc bpc" id="L67" title="1 of 2 branches missed."> if (user != null) {</span>
<span class="fc" id="L68"> user.root = root;</span>
}
<span class="fc" id="L70"> }</span>
}
</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.7.202105040129</span></div></body></html>