Files
tgstation-server/_authority_base_8cs_source.html

215 lines
42 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>tgstation-server: src/Tgstation.Server.Host/Authority/Core/AuthorityBase.cs Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">tgstation-server<span id="projectnumber">&#160;6.19.3</span>
</div>
<div id="projectbrief">The /tg/station 13 server suite</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function() { init_codefold(0); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_34761767c1c3cd212f9d2f80ea0828a8.html">Tgstation.Server.Host</a></li><li class="navelem"><a class="el" href="dir_7b5e30ed08996bf1ab2c41e458010f21.html">Authority</a></li><li class="navelem"><a class="el" href="dir_ac26146c90963479fc2fc32a1e6e42a1.html">Core</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">AuthorityBase.cs</div></div>
</div><!--header-->
<div class="contents">
<a href="_authority_base_8cs.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="keyword">using </span>System;</div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="keyword">using </span>System.Globalization;</div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span> </div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="keyword">using </span>Microsoft.Extensions.Logging;</div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span> </div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="keyword">using </span>Octokit;</div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span> </div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="keyword">using </span><a class="code hl_namespace" href="namespace_tgstation_1_1_server_1_1_api_1_1_models.html">Tgstation.Server.Api.Models</a>;</div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="keyword">using </span><a class="code hl_namespace" href="namespace_tgstation_1_1_server_1_1_api_1_1_models_1_1_response.html">Tgstation.Server.Api.Models.Response</a>;</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="keyword">using </span><a class="code hl_namespace" href="namespace_tgstation_1_1_server_1_1_host_1_1_database.html">Tgstation.Server.Host.Database</a>;</div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="keyword">using </span><a class="code hl_namespace" href="namespace_tgstation_1_1_server_1_1_host_1_1_security_1_1_rights_evaluation.html">Tgstation.Server.Host.Security.RightsEvaluation</a>;</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> </div>
<div class="foldopen" id="foldopen00013" data-start="{" data-end="}">
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"><a class="line" href="namespace_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core.html"> 13</a></span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespace_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core.html">Tgstation.Server.Host.Authority.Core</a></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span>{</div>
<div class="foldopen" id="foldopen00018" data-start="{" data-end="};">
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html"> 18</a></span> <span class="keyword">abstract</span> <span class="keyword">class </span><a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html">AuthorityBase</a> : <a class="code hl_interface" href="interface_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_i_authority.html">IAuthority</a></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> {</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#a6e451361062ea9f18d4428bf2a578597"> 23</a></span> <span class="keyword">protected</span> <a class="code hl_interface" href="interface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_context.html">IDatabaseContext</a> <a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_database_1_1_database_context.html">DatabaseContext</a> { <span class="keyword">get</span>; }</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> </div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#ac08240a96d7175f7af6966c3922593a3"> 28</a></span> <span class="keyword">protected</span> ILogger&lt;AuthorityBase&gt; <a class="code hl_property" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#ac08240a96d7175f7af6966c3922593a3">Logger</a> { <span class="keyword">get</span>; }</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> </div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#ae13097278410832e7ed9f57fb7b7e808"> 36</a></span> <span class="keyword">protected</span> <span class="keyword">static</span> <a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_response.html">AuthorityResponse&lt;TResult&gt;</a> <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#ae13097278410832e7ed9f57fb7b7e808">BadRequest&lt;TResult&gt;</a>(<a class="code hl_enumeration" href="namespace_tgstation_1_1_server_1_1_api_1_1_models.html#a1a6adb59dd51244efabf4e548e7075c8">ErrorCode</a> errorCode)</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> =&gt; <span class="keyword">new</span>(</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> <span class="keyword">new</span> <a class="code hl_class" href="class_tgstation_1_1_server_1_1_api_1_1_models_1_1_response_1_1_error_message_response.html">ErrorMessageResponse</a>(errorCode),</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <a class="code hl_enumeration" href="namespace_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core.html#a0014d9d38ddef55b17fc52f0e4bd071c">HttpFailureResponse</a>.BadRequest);</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> </div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#aad46c8d84636ee4f88bd8808ed095f75"> 46</a></span> <span class="keyword">protected</span> <span class="keyword">static</span> <a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_response.html">AuthorityResponse&lt;TResult&gt;</a> <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#aad46c8d84636ee4f88bd8808ed095f75">Unauthorized&lt;TResult&gt;</a>()</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> =&gt; <span class="keyword">new</span>(</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keyword">new</span> <a class="code hl_class" href="class_tgstation_1_1_server_1_1_api_1_1_models_1_1_response_1_1_error_message_response.html">ErrorMessageResponse</a>(),</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <a class="code hl_enumeration" href="namespace_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core.html#a0014d9d38ddef55b17fc52f0e4bd071c">HttpFailureResponse</a>.Unauthorized);</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> </div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#a52214f3e860b82f4b0286c5a14d754b6"> 56</a></span> <span class="keyword">protected</span> <span class="keyword">static</span> <a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_response.html">AuthorityResponse&lt;TResult&gt;</a> <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#a52214f3e860b82f4b0286c5a14d754b6">Gone&lt;TResult&gt;</a>()</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> =&gt; <span class="keyword">new</span>(</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <span class="keyword">new</span> <a class="code hl_class" href="class_tgstation_1_1_server_1_1_api_1_1_models_1_1_response_1_1_error_message_response.html">ErrorMessageResponse</a>(<a class="code hl_enumeration" href="namespace_tgstation_1_1_server_1_1_api_1_1_models.html#a1a6adb59dd51244efabf4e548e7075c8">ErrorCode</a>.ResourceNotPresent),</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <a class="code hl_enumeration" href="namespace_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core.html#a0014d9d38ddef55b17fc52f0e4bd071c">HttpFailureResponse</a>.Gone);</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> </div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#a0328cfee7ca898e67b9fddcd7c5991af"> 66</a></span> <span class="keyword">protected</span> <span class="keyword">static</span> <a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_response.html">AuthorityResponse&lt;TResult&gt;</a> <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#a0328cfee7ca898e67b9fddcd7c5991af">Forbid&lt;TResult&gt;</a>()</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> =&gt; <span class="keyword">new</span>(</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <span class="keyword">new</span> <a class="code hl_class" href="class_tgstation_1_1_server_1_1_api_1_1_models_1_1_response_1_1_error_message_response.html">ErrorMessageResponse</a>(),</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <a class="code hl_enumeration" href="namespace_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core.html#a0014d9d38ddef55b17fc52f0e4bd071c">HttpFailureResponse</a>.Forbidden);</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> </div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#a7dc8819f3ca336e071c7409bf858ead0"> 76</a></span> <span class="keyword">protected</span> <span class="keyword">static</span> <a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_response.html">AuthorityResponse&lt;TResult&gt;</a> <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#a7dc8819f3ca336e071c7409bf858ead0">NotFound&lt;TResult&gt;</a>()</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> =&gt; <span class="keyword">new</span>(</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="keyword">new</span> <a class="code hl_class" href="class_tgstation_1_1_server_1_1_api_1_1_models_1_1_response_1_1_error_message_response.html">ErrorMessageResponse</a>(<a class="code hl_enumeration" href="namespace_tgstation_1_1_server_1_1_api_1_1_models.html#a1a6adb59dd51244efabf4e548e7075c8">ErrorCode</a>.ResourceNeverPresent),</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <a class="code hl_enumeration" href="namespace_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core.html#a0014d9d38ddef55b17fc52f0e4bd071c">HttpFailureResponse</a>.NotFound);</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> </div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#a76b239d08d2c6a49596b41cb69d4832f"> 88</a></span> <span class="keyword">protected</span> <span class="keyword">static</span> <a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_response.html">AuthorityResponse&lt;TResult&gt;</a> <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#a76b239d08d2c6a49596b41cb69d4832f">Conflict&lt;TResult&gt;</a>(<a class="code hl_enumeration" href="namespace_tgstation_1_1_server_1_1_api_1_1_models.html#a1a6adb59dd51244efabf4e548e7075c8">ErrorCode</a> errorCode, <span class="keywordtype">string</span>? additionalData = <span class="keyword">null</span>)</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> =&gt; <span class="keyword">new</span>(</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="keyword">new</span> <a class="code hl_class" href="class_tgstation_1_1_server_1_1_api_1_1_models_1_1_response_1_1_error_message_response.html">ErrorMessageResponse</a>(errorCode)</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> {</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> AdditionalData = additionalData,</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> },</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <a class="code hl_enumeration" href="namespace_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core.html#a0014d9d38ddef55b17fc52f0e4bd071c">HttpFailureResponse</a>.Conflict);</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> </div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#a7ef76fb43443769451642d308a2049b9"> 102</a></span> <span class="keyword">protected</span> <span class="keyword">static</span> <a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_rights_evaluation_1_1_flag_rights_conditional.html">FlagRightsConditional&lt;TRights&gt;</a> <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#a7ef76fb43443769451642d308a2049b9">Flag&lt;TRights&gt;</a>(TRights flag)</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> where TRights : Enum</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> =&gt; <span class="keyword">new</span>(flag);</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> </div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#a619053cc912d1cacedcd61e1f43d0763"> 113</a></span> <span class="keyword">protected</span> <span class="keyword">static</span> <a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_rights_evaluation_1_1_or_rights_conditional.html">OrRightsConditional&lt;TRights&gt;</a> <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#a619053cc912d1cacedcd61e1f43d0763">Or&lt;TRights&gt;</a>(<a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_rights_evaluation_1_1_rights_conditional.html">RightsConditional&lt;TRights&gt;</a> lhs, <a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_rights_evaluation_1_1_rights_conditional.html">RightsConditional&lt;TRights&gt;</a> rhs)</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> where TRights : Enum</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> =&gt; <span class="keyword">new</span>(lhs, rhs);</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> </div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#aa4ecb42311d4fb34c5d70174c38fc65d"> 124</a></span> <span class="keyword">protected</span> <span class="keyword">static</span> <a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_rights_evaluation_1_1_and_rights_conditional.html">AndRightsConditional&lt;TRights&gt;</a> <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#aa4ecb42311d4fb34c5d70174c38fc65d">And&lt;TRights&gt;</a>(<a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_rights_evaluation_1_1_rights_conditional.html">RightsConditional&lt;TRights&gt;</a> lhs, <a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_rights_evaluation_1_1_rights_conditional.html">RightsConditional&lt;TRights&gt;</a> rhs)</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> where TRights : Enum</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> =&gt; <span class="keyword">new</span>(lhs, rhs);</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> </div>
<div class="foldopen" id="foldopen00133" data-start="{" data-end="}">
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#ab9aa9af0aad432e1c18d4633384cbe66"> 133</a></span> <span class="keyword">protected</span> <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#ab9aa9af0aad432e1c18d4633384cbe66">AuthorityBase</a>(</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> <a class="code hl_interface" href="interface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_context.html">IDatabaseContext</a> databaseContext,</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> ILogger&lt;AuthorityBase&gt; logger)</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> {</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> <a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_database_1_1_database_context.html">DatabaseContext</a> = databaseContext ?? <span class="keywordflow">throw</span> <span class="keyword">new</span> ArgumentNullException(nameof(databaseContext));</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <a class="code hl_property" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#ac08240a96d7175f7af6966c3922593a3">Logger</a> = logger ?? <span class="keywordflow">throw</span> <span class="keyword">new</span> ArgumentNullException(nameof(logger));</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> }</div>
</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> </div>
<div class="foldopen" id="foldopen00147" data-start="{" data-end="}">
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#ab9c6b0d8eab4fc5c07bc5d2a64cb6db3"> 147</a></span> <span class="keyword">protected</span> <a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_response.html">AuthorityResponse&lt;TResult&gt;</a> <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#ab9c6b0d8eab4fc5c07bc5d2a64cb6db3">RateLimit&lt;TResult&gt;</a>(RateLimitExceededException rateLimitException)</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> {</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> <a class="code hl_property" href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#ac08240a96d7175f7af6966c3922593a3">Logger</a>.LogWarning(rateLimitException, <span class="stringliteral">&quot;Exceeded GitHub rate limit!&quot;</span>);</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> var secondsString = Math.Ceiling(rateLimitException.GetRetryAfterTimeSpan().TotalSeconds).ToString(CultureInfo.InvariantCulture);</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> <span class="keywordflow">return</span> <span class="keyword">new</span>(</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> <span class="keyword">new</span> <a class="code hl_class" href="class_tgstation_1_1_server_1_1_api_1_1_models_1_1_response_1_1_error_message_response.html">ErrorMessageResponse</a>(<a class="code hl_enumeration" href="namespace_tgstation_1_1_server_1_1_api_1_1_models.html#a1a6adb59dd51244efabf4e548e7075c8">ErrorCode</a>.GitHubApiRateLimit)</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> {</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> AdditionalData = $<span class="stringliteral">&quot;Retry-After: {secondsString}s&quot;</span>,</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> },</div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> <a class="code hl_enumeration" href="namespace_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core.html#a0014d9d38ddef55b17fc52f0e4bd071c">HttpFailureResponse</a>.RateLimited);</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> }</div>
</div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> }</div>
</div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span>}</div>
</div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_api_1_1_models_1_1_response_1_1_error_message_response_html"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_api_1_1_models_1_1_response_1_1_error_message_response.html">Tgstation.Server.Api.Models.Response.ErrorMessageResponse</a></div><div class="ttdoc">Represents an error message returned by the server.</div><div class="ttdef"><b>Definition</b> <a href="_error_message_response_8cs_source.html#l00011">ErrorMessageResponse.cs:12</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base_html"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html">Tgstation.Server.Host.Authority.Core.AuthorityBase</a></div><div class="ttdoc">Base implementation of IAuthority.</div><div class="ttdef"><b>Definition</b> <a href="_authority_base_8cs_source.html#l00018">AuthorityBase.cs:19</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base_html_a0328cfee7ca898e67b9fddcd7c5991af"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#a0328cfee7ca898e67b9fddcd7c5991af">Tgstation.Server.Host.Authority.Core.AuthorityBase.Forbid&lt; TResult &gt;</a></div><div class="ttdeci">static AuthorityResponse&lt; TResult &gt; Forbid&lt; TResult &gt;()</div><div class="ttdoc">Generates a HttpFailureResponse.Forbidden type AuthorityResponse&lt;TResult&gt;.</div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base_html_a52214f3e860b82f4b0286c5a14d754b6"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#a52214f3e860b82f4b0286c5a14d754b6">Tgstation.Server.Host.Authority.Core.AuthorityBase.Gone&lt; TResult &gt;</a></div><div class="ttdeci">static AuthorityResponse&lt; TResult &gt; Gone&lt; TResult &gt;()</div><div class="ttdoc">Generates a HttpFailureResponse.Forbidden type AuthorityResponse&lt;TResult&gt;.</div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base_html_a619053cc912d1cacedcd61e1f43d0763"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#a619053cc912d1cacedcd61e1f43d0763">Tgstation.Server.Host.Authority.Core.AuthorityBase.Or&lt; TRights &gt;</a></div><div class="ttdeci">static OrRightsConditional&lt; TRights &gt; Or&lt; TRights &gt;(RightsConditional&lt; TRights &gt; lhs, RightsConditional&lt; TRights &gt; rhs)</div><div class="ttdoc">Helper to quickly construct an OrRightsConditional&lt;TRights&gt;.</div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base_html_a76b239d08d2c6a49596b41cb69d4832f"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#a76b239d08d2c6a49596b41cb69d4832f">Tgstation.Server.Host.Authority.Core.AuthorityBase.Conflict&lt; TResult &gt;</a></div><div class="ttdeci">static AuthorityResponse&lt; TResult &gt; Conflict&lt; TResult &gt;(ErrorCode errorCode, string? additionalData=null)</div><div class="ttdoc">Generates a HttpFailureResponse.Conflict type AuthorityResponse&lt;TResult&gt;.</div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base_html_a7dc8819f3ca336e071c7409bf858ead0"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#a7dc8819f3ca336e071c7409bf858ead0">Tgstation.Server.Host.Authority.Core.AuthorityBase.NotFound&lt; TResult &gt;</a></div><div class="ttdeci">static AuthorityResponse&lt; TResult &gt; NotFound&lt; TResult &gt;()</div><div class="ttdoc">Generates a HttpFailureResponse.NotFound type AuthorityResponse&lt;TResult&gt;.</div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base_html_a7ef76fb43443769451642d308a2049b9"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#a7ef76fb43443769451642d308a2049b9">Tgstation.Server.Host.Authority.Core.AuthorityBase.Flag&lt; TRights &gt;</a></div><div class="ttdeci">static FlagRightsConditional&lt; TRights &gt; Flag&lt; TRights &gt;(TRights flag)</div><div class="ttdoc">Helper to quickly construct a FlagRightsConditional&lt;TRights&gt;.</div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base_html_aa4ecb42311d4fb34c5d70174c38fc65d"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#aa4ecb42311d4fb34c5d70174c38fc65d">Tgstation.Server.Host.Authority.Core.AuthorityBase.And&lt; TRights &gt;</a></div><div class="ttdeci">static AndRightsConditional&lt; TRights &gt; And&lt; TRights &gt;(RightsConditional&lt; TRights &gt; lhs, RightsConditional&lt; TRights &gt; rhs)</div><div class="ttdoc">Helper to quickly construct an AndRightsConditional&lt;TRights&gt;.</div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base_html_aad46c8d84636ee4f88bd8808ed095f75"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#aad46c8d84636ee4f88bd8808ed095f75">Tgstation.Server.Host.Authority.Core.AuthorityBase.Unauthorized&lt; TResult &gt;</a></div><div class="ttdeci">static AuthorityResponse&lt; TResult &gt; Unauthorized&lt; TResult &gt;()</div><div class="ttdoc">Generates a HttpFailureResponse.Unauthorized type AuthorityResponse&lt;TResult&gt;.</div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base_html_ab9aa9af0aad432e1c18d4633384cbe66"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#ab9aa9af0aad432e1c18d4633384cbe66">Tgstation.Server.Host.Authority.Core.AuthorityBase.AuthorityBase</a></div><div class="ttdeci">AuthorityBase(IDatabaseContext databaseContext, ILogger&lt; AuthorityBase &gt; logger)</div><div class="ttdoc">Initializes a new instance of the AuthorityBase class.</div><div class="ttdef"><b>Definition</b> <a href="_authority_base_8cs_source.html#l00133">AuthorityBase.cs:133</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base_html_ab9c6b0d8eab4fc5c07bc5d2a64cb6db3"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#ab9c6b0d8eab4fc5c07bc5d2a64cb6db3">Tgstation.Server.Host.Authority.Core.AuthorityBase.RateLimit&lt; TResult &gt;</a></div><div class="ttdeci">AuthorityResponse&lt; TResult &gt; RateLimit&lt; TResult &gt;(RateLimitExceededException rateLimitException)</div><div class="ttdoc">Generates a HttpFailureResponse.RateLimited type AuthorityResponse.</div><div class="ttdef"><b>Definition</b> <a href="_authority_base_8cs_source.html#l00147">AuthorityBase.cs:147</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base_html_ac08240a96d7175f7af6966c3922593a3"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#ac08240a96d7175f7af6966c3922593a3">Tgstation.Server.Host.Authority.Core.AuthorityBase.Logger</a></div><div class="ttdeci">ILogger&lt; AuthorityBase &gt; Logger</div><div class="ttdoc">Gets the ILogger for the AuthorityBase.</div><div class="ttdef"><b>Definition</b> <a href="_authority_base_8cs_source.html#l00028">AuthorityBase.cs:28</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base_html_ae13097278410832e7ed9f57fb7b7e808"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_base.html#ae13097278410832e7ed9f57fb7b7e808">Tgstation.Server.Host.Authority.Core.AuthorityBase.BadRequest&lt; TResult &gt;</a></div><div class="ttdeci">static AuthorityResponse&lt; TResult &gt; BadRequest&lt; TResult &gt;(ErrorCode errorCode)</div><div class="ttdoc">Generates a HttpFailureResponse.BadRequest type AuthorityResponse&lt;TResult&gt;.</div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_response_html"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_authority_response.html">Tgstation.Server.Host.Authority.Core.AuthorityResponse</a></div><div class="ttdoc">Represents a response from an authority.</div><div class="ttdef"><b>Definition</b> <a href="_authority_response_02_t_result_03_8cs_source.html#l00014">AuthorityResponse{TResult}.cs:15</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_database_1_1_database_context_html"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_database_1_1_database_context.html">Tgstation.Server.Host.Database.DatabaseContext</a></div><div class="ttdoc">Backend abstract implementation of IDatabaseContext.</div><div class="ttdef"><b>Definition</b> <a href="_database_context_8cs_source.html#l00024">DatabaseContext.cs:25</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_security_1_1_rights_evaluation_1_1_and_rights_conditional_html"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_rights_evaluation_1_1_and_rights_conditional.html">Tgstation.Server.Host.Security.RightsEvaluation.AndRightsConditional</a></div><div class="ttdoc">Logical AND RightsConditional&lt;TRights&gt;.</div><div class="ttdef"><b>Definition</b> <a href="_and_rights_conditional_02_t_rights_03_8cs_source.html#l00009">AndRightsConditional{TRights}.cs:11</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_security_1_1_rights_evaluation_1_1_flag_rights_conditional_html"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_rights_evaluation_1_1_flag_rights_conditional.html">Tgstation.Server.Host.Security.RightsEvaluation.FlagRightsConditional</a></div><div class="ttdoc">Single flag RightsConditional&lt;TRights&gt;.</div><div class="ttdef"><b>Definition</b> <a href="_flag_rights_conditional_02_t_rights_03_8cs_source.html#l00010">FlagRightsConditional{TRights}.cs:12</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_security_1_1_rights_evaluation_1_1_or_rights_conditional_html"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_rights_evaluation_1_1_or_rights_conditional.html">Tgstation.Server.Host.Security.RightsEvaluation.OrRightsConditional</a></div><div class="ttdoc">Logical OR RightsConditional&lt;TRights&gt;.</div><div class="ttdef"><b>Definition</b> <a href="_or_rights_conditional_02_t_rights_03_8cs_source.html#l00009">OrRightsConditional{TRights}.cs:11</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_security_1_1_rights_evaluation_1_1_rights_conditional_html"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_rights_evaluation_1_1_rights_conditional.html">Tgstation.Server.Host.Security.RightsEvaluation.RightsConditional</a></div><div class="ttdoc">An conditional expression of TRights .</div><div class="ttdef"><b>Definition</b> <a href="_rights_conditional_02_t_rights_03_8cs_source.html#l00011">RightsConditional{TRights}.cs:13</a></div></div>
<div class="ttc" id="ainterface_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_i_authority_html"><div class="ttname"><a href="interface_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_1_1_i_authority.html">Tgstation.Server.Host.Authority.Core.IAuthority</a></div><div class="ttdoc">Business logic for interating with the server.</div><div class="ttdef"><b>Definition</b> <a href="_i_authority_8cs_source.html#l00008">IAuthority.cs:9</a></div></div>
<div class="ttc" id="ainterface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_context_html"><div class="ttname"><a href="interface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_context.html">Tgstation.Server.Host.Database.IDatabaseContext</a></div><div class="ttdoc">Represents the database.</div><div class="ttdef"><b>Definition</b> <a href="_i_database_context_8cs_source.html#l00016">IDatabaseContext.cs:17</a></div></div>
<div class="ttc" id="anamespace_tgstation_1_1_server_1_1_api_1_1_models_1_1_response_html"><div class="ttname"><a href="namespace_tgstation_1_1_server_1_1_api_1_1_models_1_1_response.html">Tgstation.Server.Api.Models.Response</a></div><div class="ttdef"><b>Definition</b> <a href="_administration_response_8cs_source.html#l00005">AdministrationResponse.cs:6</a></div></div>
<div class="ttc" id="anamespace_tgstation_1_1_server_1_1_api_1_1_models_html"><div class="ttname"><a href="namespace_tgstation_1_1_server_1_1_api_1_1_models.html">Tgstation.Server.Api.Models</a></div><div class="ttdef"><b>Definition</b> <a href="_tgstation_8_server_8_api_2_models_2_chat_channel_8cs_source.html#l00005">ChatChannel.cs:6</a></div></div>
<div class="ttc" id="anamespace_tgstation_1_1_server_1_1_api_1_1_models_html_a1a6adb59dd51244efabf4e548e7075c8"><div class="ttname"><a href="namespace_tgstation_1_1_server_1_1_api_1_1_models.html#a1a6adb59dd51244efabf4e548e7075c8">Tgstation.Server.Api.Models.ErrorCode</a></div><div class="ttdeci">ErrorCode</div><div class="ttdoc">Types of Response.ErrorMessageResponses that the API may return.</div><div class="ttdef"><b>Definition</b> <a href="_error_code_8cs_source.html#l00011">ErrorCode.cs:12</a></div></div>
<div class="ttc" id="anamespace_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_html"><div class="ttname"><a href="namespace_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core.html">Tgstation.Server.Host.Authority.Core</a></div><div class="ttdef"><b>Definition</b> <a href="_authority_base_8cs_source.html#l00013">AuthorityBase.cs:14</a></div></div>
<div class="ttc" id="anamespace_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core_html_a0014d9d38ddef55b17fc52f0e4bd071c"><div class="ttname"><a href="namespace_tgstation_1_1_server_1_1_host_1_1_authority_1_1_core.html#a0014d9d38ddef55b17fc52f0e4bd071c">Tgstation.Server.Host.Authority.Core.HttpFailureResponse</a></div><div class="ttdeci">HttpFailureResponse</div><div class="ttdoc">Indicates the type of HTTP status code an failing AuthorityResponse should generate.</div><div class="ttdef"><b>Definition</b> <a href="_http_failure_response_8cs_source.html#l00006">HttpFailureResponse.cs:7</a></div></div>
<div class="ttc" id="anamespace_tgstation_1_1_server_1_1_host_1_1_database_html"><div class="ttname"><a href="namespace_tgstation_1_1_server_1_1_host_1_1_database.html">Tgstation.Server.Host.Database</a></div><div class="ttdef"><b>Definition</b> <a href="_database_collection_8cs_source.html#l00009">DatabaseCollection.cs:10</a></div></div>
<div class="ttc" id="anamespace_tgstation_1_1_server_1_1_host_1_1_security_1_1_rights_evaluation_html"><div class="ttname"><a href="namespace_tgstation_1_1_server_1_1_host_1_1_security_1_1_rights_evaluation.html">Tgstation.Server.Host.Security.RightsEvaluation</a></div><div class="ttdef"><b>Definition</b> <a href="_and_rights_conditional_02_t_rights_03_8cs_source.html#l00003">AndRightsConditional{TRights}.cs:4</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>