Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3951


Ignore:
Timestamp:
06/25/10 19:48:26 (14 years ago)
Author:
bfarka
Message:

changed persistence for roles and implemented first Method in RoleProvider --> FinAllUsers (#1046)

Location:
branches/HeuristicLab.Services.Authentication Prototype
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Services.Authentication Prototype/HeuristicLab.Services.Authentication Prototyp.vsmdi

    r3949 r3951  
    66  <TestList name="HeuristicLabUserTestList" id="8c8759cd-2720-49fa-8e40-35ae89286ea1" parentListId="8c43106b-9dc1-4907-a29f-aa66a61bf5b6">
    77    <TestLinks>
     8      <TestLink id="23131c03-ebe9-6d64-7d73-52214a9dac7d" name="EmailTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel,   PublicKeyToken=b03f5f7f11d50a3a" />
     9      <TestLink id="d2c8a683-ac68-bded-8e0e-22e2473daa15" name="GetPasswordTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel,   PublicKeyToken=b03f5f7f11d50a3a" />
     10      <TestLink id="2b5d5229-e68f-6a88-fb76-73fa5d493613" name="LastPasswordChangedDateTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel,   PublicKeyToken=b03f5f7f11d50a3a" />
     11      <TestLink id="e3413b57-3027-8e7d-3f25-67842a5c6986" name="CommentTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel,   PublicKeyToken=b03f5f7f11d50a3a" />
     12      <TestLink id="5a5bdb37-43b0-c6f1-1b5b-7df4fecd3b8f" name="PasswordQuestionTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel,   PublicKeyToken=b03f5f7f11d50a3a" />
    813      <TestLink id="c94ce8a9-0db1-d5f7-0d29-a5b40ed93b8f" name="ChangePasswordTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel,   PublicKeyToken=b03f5f7f11d50a3a" />
     14      <TestLink id="537e2ce5-1968-64c1-932a-0aff7f0ea564" name="ToStringTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel,   PublicKeyToken=b03f5f7f11d50a3a" />
    915      <TestLink id="ecaca427-086c-9493-06af-9887f2d8184f" name="PasswordAnswerTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel,   PublicKeyToken=b03f5f7f11d50a3a" />
     16      <TestLink id="e0e05989-bce3-7e2f-d85f-30efe28be806" name="GetPasswordTest1" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel,   PublicKeyToken=b03f5f7f11d50a3a" />
    1017      <TestLink id="760cee90-ae54-277d-b10b-28dcbd0d3e2b" name="ResetPasswordTest1" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel,   PublicKeyToken=b03f5f7f11d50a3a" />
    11       <TestLink id="537e2ce5-1968-64c1-932a-0aff7f0ea564" name="ToStringTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel,   PublicKeyToken=b03f5f7f11d50a3a" />
    12       <TestLink id="b6e6a789-8f4e-329c-38ef-d9e19bd14e55" name="PasswordTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel,   PublicKeyToken=b03f5f7f11d50a3a" />
    13       <TestLink id="4452b5de-b1d7-2a87-17cf-5bcef24a98ba" name="modifyUserTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel,   PublicKeyToken=b03f5f7f11d50a3a" />
    14       <TestLink id="e0e05989-bce3-7e2f-d85f-30efe28be806" name="GetPasswordTest1" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel,   PublicKeyToken=b03f5f7f11d50a3a" />
    15       <TestLink id="ce8163d5-a5c1-2a43-04b4-3afe6a0140c3" name="ChangePasswordQuestionAndAnswerTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel,   PublicKeyToken=b03f5f7f11d50a3a" />
    16       <TestLink id="5a5bdb37-43b0-c6f1-1b5b-7df4fecd3b8f" name="PasswordQuestionTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel,   PublicKeyToken=b03f5f7f11d50a3a" />
    1718      <TestLink id="ce5df924-ff5f-962d-94e4-cbd375c40951" name="ResetPasswordTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel,   PublicKeyToken=b03f5f7f11d50a3a" />
    1819      <TestLink id="799ee04a-e351-af4d-61c5-344e29aaace3" name="UserNameTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel,   PublicKeyToken=b03f5f7f11d50a3a" />
    19       <TestLink id="23131c03-ebe9-6d64-7d73-52214a9dac7d" name="EmailTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel,   PublicKeyToken=b03f5f7f11d50a3a" />
    20       <TestLink id="d2c8a683-ac68-bded-8e0e-22e2473daa15" name="GetPasswordTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel,   PublicKeyToken=b03f5f7f11d50a3a" />
    21       <TestLink id="e3413b57-3027-8e7d-3f25-67842a5c6986" name="CommentTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel,   PublicKeyToken=b03f5f7f11d50a3a" />
    22       <TestLink id="2b5d5229-e68f-6a88-fb76-73fa5d493613" name="LastPasswordChangedDateTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel,   PublicKeyToken=b03f5f7f11d50a3a" />
     20      <TestLink id="b6e6a789-8f4e-329c-38ef-d9e19bd14e55" name="PasswordTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel,   PublicKeyToken=b03f5f7f11d50a3a" />
     21      <TestLink id="ce8163d5-a5c1-2a43-04b4-3afe6a0140c3" name="ChangePasswordQuestionAndAnswerTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel,   PublicKeyToken=b03f5f7f11d50a3a" />
     22      <TestLink id="903719dc-469b-6714-449e-0d776b005bcf" name="RoleExistsTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel,   PublicKeyToken=b03f5f7f11d50a3a" />
     23      <TestLink id="4452b5de-b1d7-2a87-17cf-5bcef24a98ba" name="modifyUserTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel,   PublicKeyToken=b03f5f7f11d50a3a" />
    2324    </TestLinks>
    2425  </TestList>
  • branches/HeuristicLab.Services.Authentication Prototype/Persistence/DataClasses.dbml

    r3943 r3951  
    1414    </Type>
    1515  </Table>
    16   <Table Name="" Member="HeuristicLabAbstractRoles">
    17     <Type Name="HeuristicLabAbstractRole" Modifier="Abstract">
     16  <Table Name="" Member="HeuristicLabRole">
     17    <Type Name="HeuristicLabRole">
    1818      <Column Name="ID" Type="System.Int64" IsReadOnly="true" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
    1919      <Column Name="roleName" Member="RoleName" Storage="_roleName" Type="System.String" CanBeNull="false" />
    20       <Column Name="parentRoleID" Member="ParentRoleID" Storage="_parentRoleID" Type="System.Int64" CanBeNull="false" />
    21       <Column Name="RoleType" Type="System.String" IsReadOnly="true" CanBeNull="false" IsDiscriminator="true" />
    22       <Association Name="HeuristicLabAbstractRole_HeuristicLabAbstractRole" Member="HeuristicLabAbstractRole2" ThisKey="ID" OtherKey="ParentRoleID" Type="HeuristicLabAbstractRole" />
    23       <Association Name="HeuristicLabAbstractRole_HeuristicLabUserRole" Member="HeuristicLabUserRole" ThisKey="ID" OtherKey="HeuristicLabRoleID" Type="HeuristicLabUserRole" />
    24       <Association Name="HeuristicLabAbstractRole_HeuristicLabAbstractRole" Member="HeuristicLabAbstractRole1" ThisKey="ParentRoleID" OtherKey="ID" Type="HeuristicLabAbstractRole" IsForeignKey="true" />
    25       <Type Name="HeuristicLabPermissionRole" InheritanceCode="permission" />
    26       <Type Name="HeuristicLabRole" InheritanceCode="role" IsInheritanceDefault="true" />
     20      <Column Name="parentRoleID" Member="ParentRoleID" Storage="_parentRoleID" Type="System.Int64" CanBeNull="true" />
     21      <Column Name="IsPermission" Type="System.Boolean" CanBeNull="false" />
     22      <Association Name="HeuristicLabRole_HeuristicLabUserRole" Member="HeuristicLabUserRole" ThisKey="ID" OtherKey="HeuristicLabRoleID" Type="HeuristicLabUserRole" />
     23      <Association Name="HeuristicLabRole_HeuristicLabRole" Member="HeuristicLabRole2" ThisKey="ID" OtherKey="ParentRoleID" Type="HeuristicLabRole" />
     24      <Association Name="HeuristicLabRole_HeuristicLabRole" Member="HeuristicLabRole1" ThisKey="ParentRoleID" OtherKey="ID" Type="HeuristicLabRole" IsForeignKey="true" />
    2725    </Type>
    2826  </Table>
     
    3331      <Column Name="HeuristicLabRoleID" Type="System.Int64" CanBeNull="false" />
    3432      <Association Name="HeuristicLabUser_HeuristicLabUserRole" Member="HeuristicLabUser" ThisKey="HeuristicLabUserID" OtherKey="ID" Type="HeuristicLabUser" IsForeignKey="true" />
    35       <Association Name="HeuristicLabAbstractRole_HeuristicLabUserRole" Member="HeuristicLabAbstractRole" ThisKey="HeuristicLabRoleID" OtherKey="ID" Type="HeuristicLabAbstractRole" IsForeignKey="true" />
     33      <Association Name="HeuristicLabRole_HeuristicLabUserRole" Member="HeuristicLabRole" Storage="_HeuristicLabAbstractRole" ThisKey="HeuristicLabRoleID" OtherKey="ID" Type="HeuristicLabRole" IsForeignKey="true" />
    3634    </Type>
    3735  </Table>
  • branches/HeuristicLab.Services.Authentication Prototype/Persistence/DataClasses.dbml.layout

    r3943 r3951  
    99      </nestedChildShapes>
    1010    </classShape>
    11     <classShape Id="c7373ccc-61b3-43fb-88fa-14149d69bee9" absoluteBounds="3.5, 0.875, 2, 1.5785953776041666">
    12       <DataClassMoniker Name="/DataClassesDataContext/HeuristicLabAbstractRole" />
     11    <classShape Id="c7373ccc-61b3-43fb-88fa-14149d69bee9" absoluteBounds="4.875, 1.125, 2, 1.5785953776041666">
     12      <DataClassMoniker Name="/DataClassesDataContext/HeuristicLabRole" />
    1313      <nestedChildShapes>
    14         <elementListCompartment Id="c418e826-fe22-4952-802e-047da829e949" absoluteBounds="3.5150000005960464, 1.3350000008940697, 1.9700000000000002, 1.0185953776041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
     14        <elementListCompartment Id="c418e826-fe22-4952-802e-047da829e949" absoluteBounds="4.8900000005960464, 1.5850000008940697, 1.9700000000000002, 1.0185953776041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    1515      </nestedChildShapes>
    1616    </classShape>
    17     <classShape Id="b49c3eca-7de0-4ace-97ce-90212955db18" absoluteBounds="6.875, 0.75, 2, 0.8093896484375">
    18       <DataClassMoniker Name="/DataClassesDataContext/HeuristicLabRole" />
    19       <nestedChildShapes>
    20         <elementListCompartment Id="b2f6a32c-1cff-4bb5-9008-e4e430125a0a" absoluteBounds="6.8900000000000006, 1.21, 1.9700000000000002, 0.2493896484375" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    21       </nestedChildShapes>
    22     </classShape>
    23     <classShape Id="d798095d-2715-4342-bc36-c2e6602a4fba" absoluteBounds="6.875, 2, 2, 0.80938964843749961">
    24       <DataClassMoniker Name="/DataClassesDataContext/HeuristicLabPermissionRole" />
    25       <nestedChildShapes>
    26         <elementListCompartment Id="8328fcdb-eadc-4d44-9aa5-5ae334106ddd" absoluteBounds="6.89, 2.46, 1.9700000000000002, 0.2493896484375" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    27       </nestedChildShapes>
    28     </classShape>
    29     <inheritanceConnector edgePoints="[(5.5 : 2.22679768880208); (6.875 : 2.22679768880208)]" fixedFrom="NotFixed" fixedTo="NotFixed" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62">
    30       <nodes>
    31         <classShapeMoniker Id="c7373ccc-61b3-43fb-88fa-14149d69bee9" />
    32         <classShapeMoniker Id="d798095d-2715-4342-bc36-c2e6602a4fba" />
    33       </nodes>
    34     </inheritanceConnector>
    35     <inheritanceConnector edgePoints="[(5.5 : 1.21719482421875); (6.875 : 1.21719482421875)]" fixedFrom="NotFixed" fixedTo="NotFixed" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62">
    36       <nodes>
    37         <classShapeMoniker Id="c7373ccc-61b3-43fb-88fa-14149d69bee9" />
    38         <classShapeMoniker Id="b49c3eca-7de0-4ace-97ce-90212955db18" />
    39       </nodes>
    40     </inheritanceConnector>
    4117    <classShape Id="032f81a1-f00c-4b0f-b4fc-8cf872ad58a6" absoluteBounds="0.625, 3.625, 2, 1.3862939453124996">
    4218      <DataClassMoniker Name="/DataClassesDataContext/HeuristicLabUserRole" />
     
    5228      </nodes>
    5329    </associationConnector>
    54     <associationConnector edgePoints="[(3.9687475 : 2.45359537760417); (3.9687475 : 4.35564697265625); (2.625 : 4.35564697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    55       <AssociationMoniker Name="/DataClassesDataContext/HeuristicLabAbstractRole/HeuristicLabAbstractRole_HeuristicLabUserRole" />
     30    <associationConnector edgePoints="[(5.19495923189603 : 2.70359537760417); (5.19495923189603 : 4.31814697265625); (2.625 : 4.31814697265625)]" fixedFrom="Algorithm" fixedTo="Algorithm">
     31      <AssociationMoniker Name="/DataClassesDataContext/HeuristicLabRole/HeuristicLabRole_HeuristicLabUserRole" />
    5632      <nodes>
    5733        <classShapeMoniker Id="c7373ccc-61b3-43fb-88fa-14149d69bee9" />
     
    5935      </nodes>
    6036    </associationConnector>
    61     <associationConnector edgePoints="[(4.20242346379207 : 0.875); (4.20242346379207 : 0.625); (4.81174684745593 : 0.625); (4.81174684745593 : 0.875)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    62       <AssociationMoniker Name="/DataClassesDataContext/HeuristicLabAbstractRole/HeuristicLabAbstractRole_HeuristicLabAbstractRole" />
     37    <associationConnector edgePoints="[(5.57742346379207 : 1.125); (5.57742346379207 : 0.875); (6.18674684745593 : 0.875); (6.18674684745593 : 1.125)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     38      <AssociationMoniker Name="/DataClassesDataContext/HeuristicLabRole/HeuristicLabRole_HeuristicLabRole" />
    6339      <nodes>
    6440        <classShapeMoniker Id="c7373ccc-61b3-43fb-88fa-14149d69bee9" />
  • branches/HeuristicLab.Services.Authentication Prototype/Persistence/DataClasses.designer.cs

    r3943 r3951  
    22//------------------------------------------------------------------------------
    33// <auto-generated>
    4 //     This code was generated by a tool.
    5 //     Runtime Version:2.0.50727.4927
     4//     Dieser Code wurde von einem Tool generiert.
     5//     Laufzeitversion:2.0.50727.4927
    66//
    7 //     Changes to this file may cause incorrect behavior and will be lost if
    8 //     the code is regenerated.
     7//     Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
     8//     der Code erneut generiert wird.
    99// </auto-generated>
    1010//------------------------------------------------------------------------------
     
    3333    partial void UpdateHeuristicLabUser(HeuristicLabUser instance);
    3434    partial void DeleteHeuristicLabUser(HeuristicLabUser instance);
    35     partial void InsertHeuristicLabAbstractRole(HeuristicLabAbstractRole instance);
    36     partial void UpdateHeuristicLabAbstractRole(HeuristicLabAbstractRole instance);
    37     partial void DeleteHeuristicLabAbstractRole(HeuristicLabAbstractRole instance);
     35    partial void InsertHeuristicLabRole(HeuristicLabRole instance);
     36    partial void UpdateHeuristicLabRole(HeuristicLabRole instance);
     37    partial void DeleteHeuristicLabRole(HeuristicLabRole instance);
    3838    partial void InsertHeuristicLabUserRole(HeuristicLabUserRole instance);
    3939    partial void UpdateHeuristicLabUserRole(HeuristicLabUserRole instance);
     
    7373    }
    7474   
    75     public System.Data.Linq.Table<HeuristicLabAbstractRole> HeuristicLabAbstractRoles
    76     {
    77       get
    78       {
    79         return this.GetTable<HeuristicLabAbstractRole>();
     75    public System.Data.Linq.Table<HeuristicLabRole> HeuristicLabRole
     76    {
     77      get
     78      {
     79        return this.GetTable<HeuristicLabRole>();
    8080      }
    8181    }
     
    297297 
    298298  [Table(Name="")]
    299   [InheritanceMapping(Code="permission", Type=typeof(HeuristicLabPermissionRole))]
    300   [InheritanceMapping(Code="role", Type=typeof(HeuristicLabRole), IsDefault=true)]
    301   public abstract partial class HeuristicLabAbstractRole : INotifyPropertyChanging, INotifyPropertyChanged
     299  public partial class HeuristicLabRole : INotifyPropertyChanging, INotifyPropertyChanged
    302300  {
    303301   
     
    308306    private string _roleName;
    309307   
    310     private long _parentRoleID;
    311    
    312     private string _RoleType = default(string);
    313    
    314     private EntitySet<HeuristicLabAbstractRole> _HeuristicLabAbstractRole2;
     308    private System.Nullable<long> _parentRoleID;
     309   
     310    private bool _IsPermission;
    315311   
    316312    private EntitySet<HeuristicLabUserRole> _HeuristicLabUserRole;
    317313   
    318     private EntityRef<HeuristicLabAbstractRole> _HeuristicLabAbstractRole1;
     314    private EntitySet<HeuristicLabRole> _HeuristicLabRole2;
     315   
     316    private EntityRef<HeuristicLabRole> _HeuristicLabRole1;
    319317   
    320318    #region Extensibility Method Definitions
     
    324322    partial void OnRoleNameChanging(string value);
    325323    partial void OnRoleNameChanged();
    326     partial void OnParentRoleIDChanging(long value);
     324    partial void OnParentRoleIDChanging(System.Nullable<long> value);
    327325    partial void OnParentRoleIDChanged();
     326    partial void OnIsPermissionChanging(bool value);
     327    partial void OnIsPermissionChanged();
    328328    #endregion
    329329   
    330     public HeuristicLabAbstractRole()
    331     {
    332       this._HeuristicLabAbstractRole2 = new EntitySet<HeuristicLabAbstractRole>(new Action<HeuristicLabAbstractRole>(this.attach_HeuristicLabAbstractRole2), new Action<HeuristicLabAbstractRole>(this.detach_HeuristicLabAbstractRole2));
     330    public HeuristicLabRole()
     331    {
    333332      this._HeuristicLabUserRole = new EntitySet<HeuristicLabUserRole>(new Action<HeuristicLabUserRole>(this.attach_HeuristicLabUserRole), new Action<HeuristicLabUserRole>(this.detach_HeuristicLabUserRole));
    334       this._HeuristicLabAbstractRole1 = default(EntityRef<HeuristicLabAbstractRole>);
     333      this._HeuristicLabRole2 = new EntitySet<HeuristicLabRole>(new Action<HeuristicLabRole>(this.attach_HeuristicLabRole2), new Action<HeuristicLabRole>(this.detach_HeuristicLabRole2));
     334      this._HeuristicLabRole1 = default(EntityRef<HeuristicLabRole>);
    335335      OnCreated();
    336336    }
     
    366366   
    367367    [Column(Name="parentRoleID", Storage="_parentRoleID")]
    368     public long ParentRoleID
     368    public System.Nullable<long> ParentRoleID
    369369    {
    370370      get
     
    385385    }
    386386   
    387     [Column(Storage="_RoleType", CanBeNull=false, UpdateCheck=UpdateCheck.Never, IsDiscriminator=true)]
    388     public string RoleType
    389     {
    390       get
    391       {
    392         return this._RoleType;
    393       }
    394     }
    395    
    396     [Association(Name="HeuristicLabAbstractRole_HeuristicLabAbstractRole", Storage="_HeuristicLabAbstractRole2", ThisKey="ID", OtherKey="ParentRoleID")]
    397     public EntitySet<HeuristicLabAbstractRole> HeuristicLabAbstractRole2
    398     {
    399       get
    400       {
    401         return this._HeuristicLabAbstractRole2;
    402       }
    403       set
    404       {
    405         this._HeuristicLabAbstractRole2.Assign(value);
    406       }
    407     }
    408    
    409     [Association(Name="HeuristicLabAbstractRole_HeuristicLabUserRole", Storage="_HeuristicLabUserRole", ThisKey="ID", OtherKey="HeuristicLabRoleID")]
     387    [Column(Storage="_IsPermission")]
     388    public bool IsPermission
     389    {
     390      get
     391      {
     392        return this._IsPermission;
     393      }
     394      set
     395      {
     396        if ((this._IsPermission != value))
     397        {
     398          this.OnIsPermissionChanging(value);
     399          this.SendPropertyChanging();
     400          this._IsPermission = value;
     401          this.SendPropertyChanged("IsPermission");
     402          this.OnIsPermissionChanged();
     403        }
     404      }
     405    }
     406   
     407    [Association(Name="HeuristicLabRole_HeuristicLabUserRole", Storage="_HeuristicLabUserRole", ThisKey="ID", OtherKey="HeuristicLabRoleID")]
    410408    public EntitySet<HeuristicLabUserRole> HeuristicLabUserRole
    411409    {
     
    420418    }
    421419   
    422     [Association(Name="HeuristicLabAbstractRole_HeuristicLabAbstractRole", Storage="_HeuristicLabAbstractRole1", ThisKey="ParentRoleID", OtherKey="ID", IsForeignKey=true)]
    423     public HeuristicLabAbstractRole HeuristicLabAbstractRole1
    424     {
    425       get
    426       {
    427         return this._HeuristicLabAbstractRole1.Entity;
    428       }
    429       set
    430       {
    431         HeuristicLabAbstractRole previousValue = this._HeuristicLabAbstractRole1.Entity;
     420    [Association(Name="HeuristicLabRole_HeuristicLabRole", Storage="_HeuristicLabRole2", ThisKey="ID", OtherKey="ParentRoleID")]
     421    public EntitySet<HeuristicLabRole> HeuristicLabRole2
     422    {
     423      get
     424      {
     425        return this._HeuristicLabRole2;
     426      }
     427      set
     428      {
     429        this._HeuristicLabRole2.Assign(value);
     430      }
     431    }
     432   
     433    [Association(Name="HeuristicLabRole_HeuristicLabRole", Storage="_HeuristicLabRole1", ThisKey="ParentRoleID", OtherKey="ID", IsForeignKey=true)]
     434    public HeuristicLabRole HeuristicLabRole1
     435    {
     436      get
     437      {
     438        return this._HeuristicLabRole1.Entity;
     439      }
     440      set
     441      {
     442        HeuristicLabRole previousValue = this._HeuristicLabRole1.Entity;
    432443        if (((previousValue != value)
    433               || (this._HeuristicLabAbstractRole1.HasLoadedOrAssignedValue == false)))
     444              || (this._HeuristicLabRole1.HasLoadedOrAssignedValue == false)))
    434445        {
    435446          this.SendPropertyChanging();
    436447          if ((previousValue != null))
    437448          {
    438             this._HeuristicLabAbstractRole1.Entity = null;
    439             previousValue.HeuristicLabAbstractRole2.Remove(this);
    440           }
    441           this._HeuristicLabAbstractRole1.Entity = value;
     449            this._HeuristicLabRole1.Entity = null;
     450            previousValue.HeuristicLabRole2.Remove(this);
     451          }
     452          this._HeuristicLabRole1.Entity = value;
    442453          if ((value != null))
    443454          {
    444             value.HeuristicLabAbstractRole2.Add(this);
     455            value.HeuristicLabRole2.Add(this);
    445456            this._parentRoleID = value.ID;
    446457          }
    447458          else
    448459          {
    449             this._parentRoleID = default(long);
    450           }
    451           this.SendPropertyChanged("HeuristicLabAbstractRole1");
     460            this._parentRoleID = default(Nullable<long>);
     461          }
     462          this.SendPropertyChanged("HeuristicLabRole1");
    452463        }
    453464      }
     
    474485    }
    475486   
    476     private void attach_HeuristicLabAbstractRole2(HeuristicLabAbstractRole entity)
     487    private void attach_HeuristicLabUserRole(HeuristicLabUserRole entity)
    477488    {
    478489      this.SendPropertyChanging();
    479       entity.HeuristicLabAbstractRole1 = this;
    480     }
    481    
    482     private void detach_HeuristicLabAbstractRole2(HeuristicLabAbstractRole entity)
     490      entity.HeuristicLabRole = this;
     491    }
     492   
     493    private void detach_HeuristicLabUserRole(HeuristicLabUserRole entity)
    483494    {
    484495      this.SendPropertyChanging();
    485       entity.HeuristicLabAbstractRole1 = null;
    486     }
    487    
    488     private void attach_HeuristicLabUserRole(HeuristicLabUserRole entity)
     496      entity.HeuristicLabRole = null;
     497    }
     498   
     499    private void attach_HeuristicLabRole2(HeuristicLabRole entity)
    489500    {
    490501      this.SendPropertyChanging();
    491       entity.HeuristicLabAbstractRole = this;
    492     }
    493    
    494     private void detach_HeuristicLabUserRole(HeuristicLabUserRole entity)
     502      entity.HeuristicLabRole1 = this;
     503    }
     504   
     505    private void detach_HeuristicLabRole2(HeuristicLabRole entity)
    495506    {
    496507      this.SendPropertyChanging();
    497       entity.HeuristicLabAbstractRole = null;
    498     }
    499   }
    500  
    501   public partial class HeuristicLabPermissionRole : HeuristicLabAbstractRole
    502   {
    503    
    504     #region Extensibility Method Definitions
    505     partial void OnLoaded();
    506     partial void OnValidate(System.Data.Linq.ChangeAction action);
    507     partial void OnCreated();
    508     #endregion
    509    
    510     public HeuristicLabPermissionRole()
    511     {
    512       OnCreated();
    513     }
    514   }
    515  
    516   public partial class HeuristicLabRole : HeuristicLabAbstractRole
    517   {
    518    
    519     #region Extensibility Method Definitions
    520     partial void OnLoaded();
    521     partial void OnValidate(System.Data.Linq.ChangeAction action);
    522     partial void OnCreated();
    523     #endregion
    524    
    525     public HeuristicLabRole()
    526     {
    527       OnCreated();
     508      entity.HeuristicLabRole1 = null;
    528509    }
    529510  }
     
    543524    private EntityRef<HeuristicLabUser> _HeuristicLabUser;
    544525   
    545     private EntityRef<HeuristicLabAbstractRole> _HeuristicLabAbstractRole;
     526    private EntityRef<HeuristicLabRole> _HeuristicLabAbstractRole;
    546527   
    547528    #region Extensibility Method Definitions
     
    560541    {
    561542      this._HeuristicLabUser = default(EntityRef<HeuristicLabUser>);
    562       this._HeuristicLabAbstractRole = default(EntityRef<HeuristicLabAbstractRole>);
     543      this._HeuristicLabAbstractRole = default(EntityRef<HeuristicLabRole>);
    563544      OnCreated();
    564545    }
     
    666647    }
    667648   
    668     [Association(Name="HeuristicLabAbstractRole_HeuristicLabUserRole", Storage="_HeuristicLabAbstractRole", ThisKey="HeuristicLabRoleID", OtherKey="ID", IsForeignKey=true)]
    669     public HeuristicLabAbstractRole HeuristicLabAbstractRole
     649    [Association(Name="HeuristicLabRole_HeuristicLabUserRole", Storage="_HeuristicLabAbstractRole", ThisKey="HeuristicLabRoleID", OtherKey="ID", IsForeignKey=true)]
     650    public HeuristicLabRole HeuristicLabRole
    670651    {
    671652      get
     
    675656      set
    676657      {
    677         HeuristicLabAbstractRole previousValue = this._HeuristicLabAbstractRole.Entity;
     658        HeuristicLabRole previousValue = this._HeuristicLabAbstractRole.Entity;
    678659        if (((previousValue != value)
    679660              || (this._HeuristicLabAbstractRole.HasLoadedOrAssignedValue == false)))
     
    695676            this._HeuristicLabRoleID = default(long);
    696677          }
    697           this.SendPropertyChanged("HeuristicLabAbstractRole");
     678          this.SendPropertyChanged("HeuristicLabRole");
    698679        }
    699680      }
  • branches/HeuristicLab.Services.Authentication Prototype/Service/Provider/HeuristicLabRoleProvider.cs

    r3943 r3951  
    11using System;
    22using System.Web.Security;
     3using System.Linq;
    34using Persistence;
    45
     
    5152
    5253    public override bool RoleExists(string roleName) {
    53       throw new NotImplementedException();
     54
     55      Persistence.DataClassesDataContext db = DatabaseUtil.createDataClassesDataContext();
     56      bool returnValue = (DatabaseUtil.createDataClassesDataContext().HeuristicLabRole.Count(r => r.RoleName == roleName) == 1);
     57      db.Connection.Close();
     58      return returnValue;
     59
    5460    }
    5561  }
  • branches/HeuristicLab.Services.Authentication Prototype/UnitTests/HeuristicLabRoleProviderTest.cs

    r3948 r3951  
    99  public class HeuristicLabRoleProviderTest : AbstractHeuristicLabTest {
    1010    private TestContext testContextInstance;
    11 
     11    private const string TEST_ROLE_NAME = "testRole";
    1212    /// <summary>
    1313    ///Gets or sets the test context which provides
     
    6969
    7070    /// <summary>
    71     ///A test for RoleExists
     71    ///tests if the RoleExits method works --> test is done in a positiv and negativ way
    7272    ///</summary>
    7373    [TestMethod()]
    7474    public void RoleExistsTest() {
    75       HeuristicLabRoleProvider target = new HeuristicLabRoleProvider(); // TODO: Initialize to an appropriate value
    76       string roleName = string.Empty; // TODO: Initialize to an appropriate value
    77       bool expected = false; // TODO: Initialize to an appropriate value
    78       bool actual;
    79       actual = target.RoleExists(roleName);
    80       Assert.AreEqual(expected, actual);
    81       Assert.Inconclusive("Verify the correctness of this test method.");
     75      HeuristicLabRoleProvider target = new HeuristicLabRoleProvider();
     76      Persistence.HeuristicLabRole role = new Persistence.HeuristicLabRole();
     77      role.RoleName = TEST_ROLE_NAME;
     78      Persistence.DataClassesDataContext db = Persistence.DatabaseUtil.createDataClassesDataContext();
     79      db.HeuristicLabRole.InsertOnSubmit((Persistence.HeuristicLabRole)role);
     80      db.SubmitChanges();
     81      Assert.IsTrue(target.RoleExists(TEST_ROLE_NAME));
     82      Assert.IsFalse(target.RoleExists(TEST_ROLE_NAME + TEST_ROLE_NAME));
    8283    }
    8384
Note: See TracChangeset for help on using the changeset viewer.