diff --git a/TGServerService/ServerInstance/Administration.cs b/TGServerService/ServerInstance/Administration.cs index 3baf5d6b05..c0f945c3b7 100644 --- a/TGServerService/ServerInstance/Administration.cs +++ b/TGServerService/ServerInstance/Administration.cs @@ -13,10 +13,22 @@ namespace TGServerService //if someone wants AD shit, code it yourself partial class ServerInstance : ServiceAuthorizationManager, ITGAdministration { + /// + /// The of the Windows group authorized to access the + /// SecurityIdentifier TheDroidsWereLookingFor; + /// + /// Used for multithreading safety + /// object authLock = new object(); - string LastSeenUser = null; + /// + /// The of the last to attempt to access the + /// + string LastSeenUser; + /// + /// The of the account the is running as + /// readonly SecurityIdentifier ServiceSID = WindowsIdentity.GetCurrent().User; /// @@ -50,6 +62,11 @@ namespace TGServerService return FindTheDroidsWereLookingFor(groupName); } + /// + /// Set based off either an ed name or a string from the config + /// + /// The name of the group to search for + /// The name of the group allowed to access the if it could be found, otherwise string FindTheDroidsWereLookingFor(string search = null) { //find the group that is authorized to use the tools @@ -75,9 +92,12 @@ namespace TGServerService } return gp.Name; } - - //This function checks for authorization whenever an API call is made - //This does NOT validate the windows account, that is done when the user connects internally + + /// + /// Called by WCF whenever a component call is made. Checks to see that the supplied user account has access to the requested component + /// + /// Various parameters about the operation supplied by WCF + /// if the supplied user account may use the requested component, otherwise protected override bool CheckAccessCore(OperationContext operationContext) { var contract = operationContext.EndpointDispatcher.ContractName; @@ -240,6 +260,8 @@ namespace TGServerService return e.ToString(); } } + + /// public string RecreateStaticFolder() { if (!Monitor.TryEnter(RepoLock))