tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
TgsAuthorizeAttribute.cs
Go to the documentation of this file.
1using System;
3using System.Linq;
4
6
8
10{
14#pragma warning disable CA1019
17 {
21 public const string UserEnabledRole = "Core.UserEnabled";
22
26 public RightsType? RightsType { get; }
27
33 {
34 }
35
42 {
43 RightsType = Api.Rights.RightsType.Administration;
44 }
45
52 {
53 RightsType = Api.Rights.RightsType.InstanceManager;
54 }
55
62 {
63 RightsType = Api.Rights.RightsType.Repository;
64 }
65
72 {
73 RightsType = Api.Rights.RightsType.Engine;
74 }
75
82 {
83 RightsType = Api.Rights.RightsType.DreamMaker;
84 }
85
92 {
93 RightsType = Api.Rights.RightsType.DreamDaemon;
94 }
95
102 {
103 RightsType = Api.Rights.RightsType.ChatBots;
104 }
105
112 {
113 RightsType = Api.Rights.RightsType.Configuration;
114 }
115
122 {
123 RightsType = Api.Rights.RightsType.InstancePermissionSet;
124 }
125
131 {
132 var listRoles = roles.ToList();
134 Roles = String.Join(",", listRoles);
135 }
136 }
137}
Helper for using the AuthorizeAttribute with the Api.Rights system.
TgsAuthorizeAttribute(InstanceManagerRights requiredRights)
Initializes a new instance of the TgsAuthorizeAttribute class.
TgsAuthorizeAttribute(IEnumerable< string > roles)
Initializes a new instance of the TgsAuthorizeAttribute class.
TgsAuthorizeAttribute(ChatBotRights requiredRights)
Initializes a new instance of the TgsAuthorizeAttribute class.
TgsAuthorizeAttribute(DreamDaemonRights requiredRights)
Initializes a new instance of the TgsAuthorizeAttribute class.
const string UserEnabledRole
Role used to indicate access to the server is allowed.
TgsAuthorizeAttribute(RepositoryRights requiredRights)
Initializes a new instance of the TgsAuthorizeAttribute class.
TgsAuthorizeAttribute(EngineRights requiredRights)
Initializes a new instance of the TgsAuthorizeAttribute class.
TgsAuthorizeAttribute(ConfigurationRights requiredRights)
Initializes a new instance of the TgsAuthorizeAttribute class.
TgsAuthorizeAttribute()
Initializes a new instance of the TgsAuthorizeAttribute class.
TgsAuthorizeAttribute(AdministrationRights requiredRights)
Initializes a new instance of the TgsAuthorizeAttribute class.
TgsAuthorizeAttribute(InstancePermissionSetRights requiredRights)
Initializes a new instance of the TgsAuthorizeAttribute class.
TgsAuthorizeAttribute(DreamMakerRights requiredRights)
Initializes a new instance of the TgsAuthorizeAttribute class.
ChatBotRights
Rights for chat bots.
ConfigurationRights
Rights for Models.IConfigurationFiles.
@ List
User may list files if the Models.Instance allows it.
DreamMakerRights
Rights for deployment.
RightsType
The type of rights a model uses.
Definition RightsType.cs:7
EngineRights
Rights for engine version management.
RepositoryRights
Rights for the git repository.
InstancePermissionSetRights
Rights for an Models.Instance.
DreamDaemonRights
Rights for managing DreamDaemon.
InstanceManagerRights
Rights for managing Models.Instances.
AdministrationRights
Administration rights for the server.