mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-28 23:52:36 +01:00
Convert rights flags to ulong
This commit is contained in:
@@ -6,7 +6,7 @@ namespace Tgstation.Server.Api.Rights
|
||||
/// Rights for <see cref="Models.Administration"/>
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum AdministrationRights
|
||||
public enum AdministrationRights : ulong
|
||||
{
|
||||
/// <summary>
|
||||
/// User has no rights
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Tgstation.Server.Api.Rights
|
||||
/// Rights for <see cref="Models.Byond"/>
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum ByondRights
|
||||
public enum ByondRights : ulong
|
||||
{
|
||||
/// <summary>
|
||||
/// User has no rights
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Tgstation.Server.Api.Rights
|
||||
/// Rights for <see cref="Models.ChatSettings"/>
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum ChatSettingsRights
|
||||
public enum ChatSettingsRights : ulong
|
||||
{
|
||||
/// <summary>
|
||||
/// User has no rights
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Tgstation.Server.Api.Rights
|
||||
/// Rights for <see cref="Models.ConfigurationFile"/>
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum ConfigurationRights
|
||||
public enum ConfigurationRights : ulong
|
||||
{
|
||||
/// <summary>
|
||||
/// User has no rights
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Tgstation.Server.Api.Rights
|
||||
/// Rights for <see cref="Models.DreamDaemon"/>
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum DreamDaemonRights
|
||||
public enum DreamDaemonRights : ulong
|
||||
{
|
||||
/// <summary>
|
||||
/// User has no rights
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Tgstation.Server.Api.Rights
|
||||
/// Rights for <see cref="Models.DreamMaker"/>
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum DreamMakerRights
|
||||
public enum DreamMakerRights : ulong
|
||||
{
|
||||
/// <summary>
|
||||
/// User has no rights
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Tgstation.Server.Api.Rights
|
||||
/// Rights for managing <see cref="Models.Instance"/>s
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum InstanceManagerRights
|
||||
public enum InstanceManagerRights : ulong
|
||||
{
|
||||
/// <summary>
|
||||
/// User has no rights
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Tgstation.Server.Api.Rights
|
||||
/// Rights for an <see cref="Models.Instance"/>
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum InstanceUserRights
|
||||
public enum InstanceUserRights : ulong
|
||||
{
|
||||
/// <summary>
|
||||
/// User has no rights
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Tgstation.Server.Api.Rights
|
||||
/// Rights for a <see cref="Models.Repository"/>
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum RepositoryRights
|
||||
public enum RepositoryRights : ulong
|
||||
{
|
||||
/// <summary>
|
||||
/// User has no rights
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/// <summary>
|
||||
/// The type of rights a model uses
|
||||
/// </summary>
|
||||
public enum RightsType
|
||||
public enum RightsType : ulong
|
||||
{
|
||||
/// <summary>
|
||||
/// <see cref="AdministrationRights"/>
|
||||
|
||||
@@ -25,12 +25,12 @@
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<WarningsAsErrors />
|
||||
<DocumentationFile>bin\Release\netstandard2.0\Tgstation.Server.Api.xml</DocumentationFile>
|
||||
<NoWarn>1701;1702;1705;CA2227;CA1819</NoWarn>
|
||||
<NoWarn>1701;1702;1705;CA2227;CA1819;CA1028</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<LangVersion>latest</LangVersion>
|
||||
<NoWarn>1701;1702;1705;CA2227;CA1819</NoWarn>
|
||||
<NoWarn>1701;1702;1705;CA2227;CA1819;CA1028</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Tgstation.Server.Host.Components.Compiler
|
||||
/// <param name="apiValidateTimeout">The time in seconds to wait while validating the API</param>
|
||||
/// <param name="repository">The <see cref="IRepository"/> to copy from</param>
|
||||
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the operation</param>
|
||||
/// <returns>A <see cref="Task{TResult}"/> resulting in the partially populated <see cref="CompileJob"/> for the operation. In particular, note the <see cref="CompileJob.RevisionInformation"/> field will only have it's <see cref="Api.Models.Internal.RevisionInformation.CommitSha"/> field populated</returns>
|
||||
/// <returns>A <see cref="Task{TResult}"/> resulting in the partially populated <see cref="Models.CompileJob"/> for the operation. In particular, note the <see cref="Models.CompileJob.RevisionInformation"/> field will only have it's <see cref="Api.Models.Internal.RevisionInformation.CommitSha"/> field populated</returns>
|
||||
Task<Models.CompileJob> Compile(Models.RevisionInformation revisionInformation, DreamMakerSettings dreamMakerSettings, DreamDaemonSecurity securityLevel, uint apiValidateTimeout, IRepository repository, CancellationToken cancellationToken);
|
||||
}
|
||||
}
|
||||
@@ -80,13 +80,13 @@ namespace Tgstation.Server.Host.Controllers
|
||||
|
||||
Models.InstanceUser InstanceAdminUser() => new Models.InstanceUser
|
||||
{
|
||||
ByondRights = (ByondRights)~0,
|
||||
ChatSettingsRights = (ChatSettingsRights)~0,
|
||||
ConfigurationRights = (ConfigurationRights)~0,
|
||||
DreamDaemonRights = (DreamDaemonRights)~0,
|
||||
DreamMakerRights = (DreamMakerRights)~0,
|
||||
RepositoryRights = (RepositoryRights)~0,
|
||||
InstanceUserRights = (InstanceUserRights)~0,
|
||||
ByondRights = (ByondRights)~0U,
|
||||
ChatSettingsRights = (ChatSettingsRights)~0U,
|
||||
ConfigurationRights = (ConfigurationRights)~0U,
|
||||
DreamDaemonRights = (DreamDaemonRights)~0U,
|
||||
DreamMakerRights = (DreamMakerRights)~0U,
|
||||
RepositoryRights = (RepositoryRights)~0U,
|
||||
InstanceUserRights = (InstanceUserRights)~0U,
|
||||
UserId = AuthenticationContext.User.Id
|
||||
};
|
||||
|
||||
|
||||
@@ -40,9 +40,9 @@ namespace Tgstation.Server.Host.Models
|
||||
{
|
||||
var admin = new User
|
||||
{
|
||||
AdministrationRights = (AdministrationRights)~0,
|
||||
AdministrationRights = (AdministrationRights)~0U,
|
||||
CreatedAt = DateTimeOffset.Now,
|
||||
InstanceManagerRights = (InstanceManagerRights)~0,
|
||||
InstanceManagerRights = (InstanceManagerRights)~0U,
|
||||
Name = AdminName,
|
||||
CanonicalName = AdminName.ToUpperInvariant(),
|
||||
Enabled = true,
|
||||
|
||||
Reference in New Issue
Block a user