- Timestamp:
- 06/19/09 14:15:12 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Server.Core/3.2/Authorization/HivePermissions.cs
r2065 r2070 6 6 using HeuristicLab.Security.Contracts.BusinessObjects; 7 7 using System.Diagnostics; 8 using System.Xml; 9 using System.IO; 10 using System.Reflection; 8 11 9 12 namespace HeuristicLab.Hive.Server.Core { 10 13 11 14 public static class HivePermissions { 12 private const string PERMISSIONFILE = "Authorization//HivePermissionSet.xml";13 private const string POLICIESFILE = "Authorization//HivePermissionPolicy.xml";15 private const string PERMISSIONFILE = @"plugins\HivePermissionSet.xml"; 16 private const string POLICIESFILE = @"plugins\HivePermissionPolicy.xml"; 14 17 15 18 public static class Jobmanagement { … … 144 147 Permission p = null; 145 148 XPathDocument doc; 149 string assemblyName = Assembly.GetAssembly(typeof(HivePermissions)).GetName().Name; 146 150 doc = new XPathDocument(filename); 147 151 XPathNavigator nav = doc.CreateNavigator(); … … 164 168 } while (nav.MoveToFollowing(XPathNodeType.Element)); 165 169 } 166 170 /* 171 public static XmlDocument GetEmbeddedXml(Type type, string fileName) { 172 Stream str = GetEmbeddedFile(type, fileName); 173 XmlTextReader tr = new XmlTextReader(str); 174 XmlDocument xml = new XmlDocument(); 175 xml.Load(tr); 176 return xml; 177 } 178 */ 179 180 /// <summary> 181 /// Extracts an embedded file out of a given assembly. 182 /// </summary> 183 /// <param name="assemblyName">The namespace of you assembly.</param> 184 /// <param name="fileName">The name of the file to extract.</param> 185 /// <returns>A stream containing the file data.</returns> 186 public static Stream GetEmbeddedFile(string assemblyName, string fileName) { 187 try { 188 Assembly a = Assembly.Load(assemblyName); 189 Stream str = a.GetManifestResourceStream(assemblyName + "." + fileName); 190 191 if (str == null) 192 throw new Exception("Could not locate embedded resource '" + fileName + "' in assembly '" + assemblyName + "'"); 193 return str; 194 } 195 catch (Exception e) { 196 throw new Exception(assemblyName + ": " + e.Message); 197 } 198 } 199 200 167 201 /// <summary> 168 202 /// Policy … … 172 206 private static void LoadFromXml(IList<Policy> policyList, string filename) { 173 207 PermissionCollection permissionCollection = GetPermissions(); 208 string assemblyName = Assembly.GetAssembly(typeof(HivePermissions)).GetName().Name; 174 209 XPathDocument doc = new XPathDocument(filename); 175 210 XPathNavigator nav = doc.CreateNavigator(); -
trunk/sources/HeuristicLab.Hive.Server.Core/3.2/HeuristicLab.Hive.Server.Core-3.2.csproj
r2065 r2070 162 162 </ItemGroup> 163 163 <ItemGroup> 164 <Content Include="Authorization\HivePermissionPolicy.xml" /> 164 <EmbeddedResource Include="Authorization\HivePermissionPolicy.xml"> 165 <CopyToOutputDirectory>Always</CopyToOutputDirectory> 166 </EmbeddedResource> 165 167 </ItemGroup> 166 168 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> -
trunk/sources/HeuristicLab/CopyAssemblies.cmd
r2058 r2070 124 124 copy "%SolutionDir%\HeuristicLab.Security.ADODataAccess\3.2\%Outdir%\HeuristicLab.Security.ADODataAccess-3.2.dll" .\plugins 125 125 copy "%SolutionDir%\HeuristicLab.Security.Server\3.2\%Outdir%\HeuristicLab.Security.Server-3.2.dll" .\plugins 126 126 copy "%SolutionDir%\HeuristicLab.Hive.Server.Core\3.2\%Outdir%\Authorization\*.xml" .\plugins 127 127 echo "Platform: %Platform%, architecture: %PROCESSOR_ARCHITECTURE%" 128 128 if "%Platform%" == "x86" (
Note: See TracChangeset
for help on using the changeset viewer.