/// <summary> /// Verify that the current user has permission to perform an import. /// </summary> /// <param name="source"></param> /// <param name="context"></param> private void CheckImportSecurity(IDataSource source, IProcessingContext context) { SecurityProcessor.CheckUserInRole(new EntityRef("core:importExportRole")); SecurityProcessor.CheckTypeCreatePermissions(source, context); SecurityProcessor.CheckEntityPermissions(source, new[] { Permissions.Modify }, context); }
public void Init(string Version, string VersionName, int Schedule, int NumofgridviewPage_perrows, int SelectTopN, string C_DBConnstring, string SystemHashAlg, string SystemSlat, string SystemDateTimeFormat, string SplitSymbol, string SplitSymbol2, string SplitSymbol3, int PublicRoleID, string CreateAction, string EditAction, string RemoveAction, string InsertAction, string UpdateAction, string DeleteAction, string GetAction, string ReviewAction, string VerifyAction, string SearchAction, string LoginAction, string LogoutAction, string UploadPath, string MailServer, int MailServerPort, string MailSender, List <string> MailReceiver, List <string> MailCC, bool MailUseSSL, bool MailBodyUseHTML, string MailPriority, int MailCodePage, string MailSubject, string MailBody, List <string> TextReceivers, string TextSubject, string TextBody) { Char[] splitsymbol = { ',' }; this.Version = Version; this.VersionName = VersionName; this.Schedule = Schedule; this.NumofgridviewPage_perrows = NumofgridviewPage_perrows; this.SelectTopN = Convert.ToInt16(SelectTopN); this.C_DBConnstring = SecurityProcessor.TurnBase642String(C_DBConnstring); this.SystemHashAlg = SystemHashAlg; this.SystemSlat = SystemSlat; this.SystemDateTimeFormat = SystemDateTimeFormat; this.SplitSymbol = SplitSymbol; this.SplitSymbol2 = SplitSymbol2; this.SplitSymbol3 = SplitSymbol3; this.PublicRoleID = PublicRoleID; this.CreateAction = CreateAction; this.EditAction = EditAction; this.RemoveAction = RemoveAction; this.InsertAction = InsertAction; this.UpdateAction = UpdateAction; this.DeleteAction = DeleteAction; this.GetAction = GetAction; this.ReviewAction = ReviewAction; this.VerifyAction = VerifyAction; this.SearchAction = SearchAction; this.LoginAction = LoginAction; this.LogoutAction = LogoutAction; this.UploadPath = UploadPath; this.MailServer = MailServer; this.MailServerPort = Convert.ToInt16(MailServerPort); this.MailSender = MailSender; this.MailReceiver = MailReceiver; this.MailCC = MailCC; this.MailUseSSL = MailUseSSL; this.MailBodyUseHTML = MailBodyUseHTML; this.MailPriority = MailPriority; this.MailCodePage = MailCodePage; this.MailSubject = MailSubject; this.MailBody = MailBody; this.TextReceivers = TextReceivers; this.TextSubject = TextSubject; this.TextBody = TextBody; }
public async Task <IHttpActionResult> Post(AscDeployment deployment) { var securityProcessor = new SecurityProcessor(); var userHasAccess = securityProcessor.CheckUserPermissionToSubscription(deployment.SubscriptionId); if (!userHasAccess) { throw new HttpResponseException(HttpStatusCode.Forbidden); } var template = await repository.GetTemplate(deployment.TemplateName); deployment.Template = template.TemplateData; var result = await DeploymentManager.Deploy(deployment); return(this.Ok(result)); }
public async Task <IHttpActionResult> Post(ResourceGroupResource resourceGroup) { var securityProcessor = new SecurityProcessor(); var userHasAccess = securityProcessor.CheckUserPermissionToSubscription(resourceGroup.SubscriptionId); if (!userHasAccess) { throw new HttpResponseException(HttpStatusCode.Forbidden); } var client = Utils.GetResourceManagementClient(resourceGroup.SubscriptionId); var rg = new ResourceGroup(resourceGroup.Location); var result = await client.ResourceGroups.CreateOrUpdateAsync(resourceGroup.ResourceGroupName, rg, new CancellationToken()); await securityProcessor.AddGroupsToAscContributorRole(resourceGroup.SubscriptionId, resourceGroup.ResourceGroupName, resourceGroup.ContributorGroups); return(this.Ok(resourceGroup)); }
public void Init(string Version, int Schedule, int NumofgridviewPage_perrows, int SelectTopN, string C_DBConnstring, string SystemURL, string VAVerifyURL, string SystemHashAlg, string SystemDateTimeFormat, string SplitSymbol, string SplitSymbol2, string SplitSymbol3, int PublicRoleID, string MailServer, int MailServerPort, string MailSender, List <string> MailReceiver, List <string> MailCC, bool MailUseSSL, bool MailBodyUseHTML, string MailPriority, int MailCodePage, string MailSubject, string MailBody, List <string> TextReceivers, string TextSubject, string TextBody) { Char[] splitsymbol = { ',' }; this.Version = Version; this.Schedule = Schedule; this.NumofgridviewPage_perrows = NumofgridviewPage_perrows; this.SelectTopN = Convert.ToInt16(SelectTopN); this.VAVerifyURL = VAVerifyURL; this.SystemURL = SystemURL; this.C_DBConnstring = SecurityProcessor.TurnBase642String(C_DBConnstring); this.SystemHashAlg = SystemHashAlg; this.SystemDateTimeFormat = SystemDateTimeFormat; this.SplitSymbol = SplitSymbol; this.SplitSymbol2 = SplitSymbol2; this.SplitSymbol3 = SplitSymbol3; this.PublicRoleID = PublicRoleID; this.MailServer = MailServer; this.MailServerPort = Convert.ToInt16(MailServerPort); this.MailSender = MailSender; this.MailReceiver = MailReceiver; this.MailCC = MailCC; this.MailUseSSL = MailUseSSL; this.MailBodyUseHTML = MailBodyUseHTML; this.MailPriority = MailPriority; this.MailCodePage = MailCodePage; this.MailSubject = MailSubject; this.MailBody = MailBody; this.TextReceivers = TextReceivers; this.TextSubject = TextSubject; this.TextBody = TextBody; }