[AllowAnonymous] // will do security check internally
 public HttpResponseMessage ExportContent(int appId, string language, string defaultLanguage, string contentType,
                                          ExportSelection recordExport, ExportResourceReferenceMode resourcesReferences,
                                          ExportLanguageResolution languageReferences, string selectedIds = null)
 {
     Log.Add($"export content start app:{appId}, language:{language}, defLang:{defaultLanguage}, type:{contentType}, ids:{selectedIds}");
     // do security check and get data
     return(PortalSettings.UserInfo.IsInRole(PortalSettings.AdministratorRoleName)
         ? _eavCtc.ExportContent(appId, language, defaultLanguage, contentType,
                                 recordExport, resourcesReferences,
                                 languageReferences, selectedIds)
         : throw new HttpRequestException("Needs admin permissions to do this"));
 }
Beispiel #2
0
 public HttpResponseMessage ExportContent(int appId, string language, string defaultLanguage, string contentType,
                                          RecordExport recordExport, ResourceReferenceExport resourcesReferences,
                                          LanguageReferenceExport languageReferences)
 {
     // do security check
     if (!PortalSettings.UserInfo.IsInRole("Administrators")) // note: user.isinrole didn't work
     {
         throw new HttpRequestException("Needs admin permissions to do this");
     }
     return(eavCtc.ExportContent(appId, language, defaultLanguage, contentType, recordExport, resourcesReferences,
                                 languageReferences));
 }