tgstation-server 6.12.3
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 PolicyName = "Policy.UserEnabled";
22
26 public const string UserEnabledRole = "Role.UserEnabled";
27
31 public RightsType? RightsType { get; }
32
38 {
39 }
40
47 {
48 RightsType = Api.Rights.RightsType.Administration;
49 }
50
57 {
58 RightsType = Api.Rights.RightsType.InstanceManager;
59 }
60
67 {
68 RightsType = Api.Rights.RightsType.Repository;
69 }
70
77 {
78 RightsType = Api.Rights.RightsType.Engine;
79 }
80
87 {
88 RightsType = Api.Rights.RightsType.DreamMaker;
89 }
90
97 {
98 RightsType = Api.Rights.RightsType.DreamDaemon;
99 }
100
107 {
108 RightsType = Api.Rights.RightsType.ChatBots;
109 }
110
117 {
118 RightsType = Api.Rights.RightsType.Configuration;
119 }
120
127 {
128 RightsType = Api.Rights.RightsType.InstancePermissionSet;
129 }
130
136 {
137 var listRoles = roles.ToList();
138 if (listRoles.Count != 0)
139 {
140 Roles = String.Join(",", listRoles);
141 }
142
144 }
145 }
146}
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 PolicyName
Policy used to apply global requirement of UserEnabledRole.
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.