Skip to content

settings Key, AuthorisationKey for role and user and activity log #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions HomeCinema.Entities/ActivityLog.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HomeCinema.Entities
{
public class ActivityLog :IEntityBase
{
public int ID { get; set; }
public int ActivityLogTypeID { get; set; }
public string UserName { get; set; }
public int UserId { get; set; }
public string Comment { get; set; }
public DateTime DateUTC { get; set; }
public string IpAddress { get; set; }
public virtual User User { get; set; }
public virtual ActivityLogType ActivityLogType { get; set; }

}
}
16 changes: 16 additions & 0 deletions HomeCinema.Entities/ActivityLogType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HomeCinema.Entities
{
public class ActivityLogType : IEntityBase
{
public int ID { get; set; }
public string SystemKeyword { get; set; }
public string Name { get; set; }
public bool Enabled { get; set; }
}
}
122 changes: 67 additions & 55 deletions HomeCinema.Entities/HomeCinema.Entities.csproj
Original file line number Diff line number Diff line change
@@ -1,62 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{3E8BB046-05BD-4D27-94A7-C13AD4F3E192}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>HomeCinema.Entities</RootNamespace>
<AssemblyName>HomeCinema.Entities</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Customer.cs" />
<Compile Include="Error.cs" />
<Compile Include="Genre.cs" />
<Compile Include="IEntityBase.cs" />
<Compile Include="Movie.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Rental.cs" />
<Compile Include="Role.cs" />
<Compile Include="Stock.cs" />
<Compile Include="User.cs" />
<Compile Include="UserRole.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{3E8BB046-05BD-4D27-94A7-C13AD4F3E192}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>HomeCinema.Entities</RootNamespace>
<AssemblyName>HomeCinema.Entities</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ActivityLog.cs" />
<Compile Include="ActivityLogType.cs" />
<Compile Include="Customer.cs" />
<Compile Include="Error.cs" />
<Compile Include="Genre.cs" />
<Compile Include="IEntityBase.cs" />
<Compile Include="Movie.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Rental.cs" />
<Compile Include="Role.cs" />
<Compile Include="RolePermission.cs" />
<Compile Include="Setting.cs" />
<Compile Include="Settings\ISettings.cs" />
<Compile Include="Settings\ServerSettings.cs" />
<Compile Include="UserPermission.cs" />
<Compile Include="Stock.cs" />
<Compile Include="User.cs" />
<Compile Include="UserPreference.cs" />
<Compile Include="UserRole.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
-->
</Project>
10 changes: 10 additions & 0 deletions HomeCinema.Entities/HomeCinema.Entities.csproj.vspscc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
""
{
"FILE_VERSION" = "9237"
"ENLISTMENT_CHOICE" = "NEVER"
"PROJECT_FILE_RELATIVE_PATH" = ""
"NUMBER_OF_EXCLUDED_FILES" = "0"
"ORIGINAL_PROJECT_FILE_PATH" = ""
"NUMBER_OF_NESTED_PROJECTS" = "0"
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
}
16 changes: 16 additions & 0 deletions HomeCinema.Entities/RolePermission.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HomeCinema.Entities
{
public class RolePermission : IEntityBase
{
public int ID { get; set; }
public int RoleId { get; set; }
public string PermissionKey { get; set; }
public virtual Role Role { get; set; }
}
}
21 changes: 21 additions & 0 deletions HomeCinema.Entities/Setting.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HomeCinema.Entities
{
public class Setting :IEntityBase
{
public int ID { get; set; }
public string Name { get; set; }
public string Value { get; set; }
public int AppScope { get; set; }
public DateTime CreatedAt { get; set; }
public Nullable<DateTime> UpdatedAt { get; set; }
public string CreatedBy { get; set; }
public string UpdatedBy { get; set; }
public string Description { get; set; }
}
}
12 changes: 12 additions & 0 deletions HomeCinema.Entities/Settings/ISettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HomeCinema.Entities.Settings
{
public interface ISettings
{
}
}
64 changes: 64 additions & 0 deletions HomeCinema.Entities/Settings/ServerSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HomeCinema.Entities.Settings
{
// classe de paramétrage hérite de ISettings et manupilable avec SetttingService
public class ServerSettings : ISettings
{
public ServerSettings()
{
}
/// <summary>
/// Gets or sets a value indicating "sqlServer master Admin account name"
/// </summary>
public string sqlServerAdmin { get; set; }
/// <summary>
/// Gets or sets a value indicating "sqlServer master Admin password"
/// </summary>
public string sqlServerPassword { get; set; }
/// <summary>
/// Gets or sets a value indicating "api access token expire in"
/// </summary>
public int accessTokenExpireTimeSpan { get; set; }
/// <summary>
/// Gets or sets a value indicating "mail Admin account name"
/// </summary>
public string mailAdmin { get; set; }
/// <summary>
/// Gets or sets a value indicating "mail Admin account server"
/// </summary>
public string mailPassword { get; set; }
/// <summary>
/// Gets or sets a value indicating "mail account password"
/// </summary>
public string smtpServer { get; set; }
/// <summary>
/// Gets or sets a value indicating "mail SMTP account Port"
/// </summary>
public string smtpPort { get; set; }
/// <summary>
/// Gets or sets a value indicating "user account password required length"
/// </summary>
public int RequiredLength { get; set; }
/// <summary>
/// Gets or sets a value indicating "UserLockoutEnabledByDefault"
/// </summary>
public bool UserLockoutEnabledByDefault { get; set; }
/// <summary>
/// Gets or sets a value indicating "DefaultAccountLockoutTimeSpan"
/// </summary>
public TimeSpan DefaultAccountLockoutTimeSpan { get; set; }
/// <summary>
/// Gets or sets a value indicating "MaxFailedAccessAttemptsBeforeLockout"
/// </summary>
public int MaxFailedAccessAttemptsBeforeLockout { get; set; }
/// <summary>
/// Gets or sets a value indicating "Niveau Log"
/// </summary>
public string LogLevel { get; set; }
}
}
4 changes: 3 additions & 1 deletion HomeCinema.Entities/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public User()
public bool IsLocked { get; set; }
public DateTime DateCreated { get; set; }

public virtual ICollection<UserRole> UserRoles { get; set; }
public virtual ICollection<UserRole> UserRoles { get; set; }
public virtual ICollection<UserPermission> UserPermissions { get; set; }

}
}
17 changes: 17 additions & 0 deletions HomeCinema.Entities/UserPermission.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HomeCinema.Entities
{
public class UserPermission : IEntityBase
{
public int ID { get; set; }
public int UserId { get; set; }
public string PermissionKey { get; set; }
public bool Granted { get; set; }
public virtual User User { get; set; }
}
}
23 changes: 23 additions & 0 deletions HomeCinema.Entities/UserPreference.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HomeCinema.Entities
{
public class UserPreference:IEntityBase
{
public int ID { get; set; }

public int UserId { get; set; }

public string PreferenceType { get; set; }

public string Name { get; set; }

public string Value { get; set; }
public virtual User User { get; set; }

}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
C:\Users\shank\Documents\Visual Studio 2015\Projects\spa-webapi-angularjs-master\HomeCinema.Entities\bin\Debug\HomeCinema.Entities.dll
C:\Users\shank\Documents\Visual Studio 2015\Projects\spa-webapi-angularjs-master\HomeCinema.Entities\bin\Debug\HomeCinema.Entities.pdb
C:\Users\shank\Documents\Visual Studio 2015\Projects\spa-webapi-angularjs-master\HomeCinema.Entities\obj\Debug\HomeCinema.Entities.csprojResolveAssemblyReference.cache
C:\Users\shank\Documents\Visual Studio 2015\Projects\spa-webapi-angularjs-master\HomeCinema.Entities\obj\Debug\HomeCinema.Entities.dll
C:\Users\shank\Documents\Visual Studio 2015\Projects\spa-webapi-angularjs-master\HomeCinema.Entities\obj\Debug\HomeCinema.Entities.pdb
Binary file not shown.
Binary file not shown.
Binary file not shown.
38 changes: 20 additions & 18 deletions HomeCinema.Services/Abstract/IMembershipService.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
using HomeCinema.Entities;
using HomeCinema.Services.Utilities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HomeCinema.Services
{
public interface IMembershipService
{
MembershipContext ValidateUser(string username, string password);
User CreateUser(string username, string email, string password, int[] roles);
User GetUser(int userId);
List<Role> GetUserRoles(string username);
}
}
using HomeCinema.Entities;
using HomeCinema.Services.Utilities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HomeCinema.Services
{
public interface IMembershipService
{
MembershipContext ValidateUser(string username, string password);
User CreateUser(string username, string email, string password, int[] roles);
User GetUser(int userId);
User GetUserByName(string userName);

List<Role> GetUserRoles(string username);
}
}
Loading