-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
485 changed files
with
114,944 additions
and
58,797 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ obj | |
*.exe | ||
*.suo | ||
*.user | ||
.my | ||
.my | ||
/src/Frapid.Web/Catalogs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/Frapid.Web/Areas/Frapid.Account/DashboardControllers/ConfigurationProfileController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System.Web.Mvc; | ||
using Frapid.Dashboard.Controllers; | ||
|
||
namespace Frapid.Account.DashboardControllers | ||
{ | ||
public class ConfigurationProfileController : DashboardController | ||
{ | ||
[Route("dashboard/account/configuration-profile")] | ||
[Authorize] | ||
public ActionResult Index() | ||
{ | ||
return this.FrapidView(this.GetRazorView<AreaRegistration>("ConfigurationProfile/Index.cshtml")); | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/Frapid.Web/Areas/Frapid.Account/DashboardControllers/RoleController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System.Web.Mvc; | ||
using Frapid.Dashboard.Controllers; | ||
|
||
namespace Frapid.Account.DashboardControllers | ||
{ | ||
public class RoleController : DashboardController | ||
{ | ||
[Route("dashboard/account/roles")] | ||
[Authorize] | ||
public ActionResult Index() | ||
{ | ||
return this.FrapidView(this.GetRazorView<AreaRegistration>("Role/Index.cshtml")); | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/Frapid.Web/Areas/Frapid.Account/DashboardControllers/UserController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System.Web.Mvc; | ||
using Frapid.Dashboard.Controllers; | ||
|
||
namespace Frapid.Account.DashboardControllers | ||
{ | ||
public class UserController : DashboardController | ||
{ | ||
[Route("dashboard/account/user-management")] | ||
[Authorize] | ||
public ActionResult Index() | ||
{ | ||
return this.FrapidView(this.GetRazorView<AreaRegistration>("User/Index.cshtml")); | ||
} | ||
} | ||
} |
91 changes: 91 additions & 0 deletions
91
src/Frapid.Web/Areas/Frapid.Account/DataAccess/CanConfirmRegistrationProcedure.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
// ReSharper disable All | ||
using Npgsql; | ||
using Serilog; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Frapid.Account.Entities; | ||
using Frapid.DataAccess; | ||
using Frapid.DataAccess.Models; | ||
using Frapid.DbPolicy; | ||
using Frapid.Framework.Extensions; | ||
namespace Frapid.Account.DataAccess | ||
{ | ||
/// <summary> | ||
/// Prepares, validates, and executes the function "account.can_confirm_registration(_token uuid)" on the database. | ||
/// </summary> | ||
public class CanConfirmRegistrationProcedure : DbAccess, ICanConfirmRegistrationRepository | ||
{ | ||
/// <summary> | ||
/// The schema of this PostgreSQL function. | ||
/// </summary> | ||
public override string _ObjectNamespace => "account"; | ||
/// <summary> | ||
/// The schema unqualified name of this PostgreSQL function. | ||
/// </summary> | ||
public override string _ObjectName => "can_confirm_registration"; | ||
/// <summary> | ||
/// Login id of application user accessing this PostgreSQL function. | ||
/// </summary> | ||
public long _LoginId { get; set; } | ||
/// <summary> | ||
/// User id of application user accessing this table. | ||
/// </summary> | ||
public int _UserId { get; set; } | ||
/// <summary> | ||
/// The name of the database on which queries are being executed to. | ||
/// </summary> | ||
public string _Catalog { get; set; } | ||
|
||
/// <summary> | ||
/// Maps to "_token" argument of the function "account.can_confirm_registration". | ||
/// </summary> | ||
public System.Guid Token { get; set; } | ||
|
||
/// <summary> | ||
/// Prepares, validates, and executes the function "account.can_confirm_registration(_token uuid)" on the database. | ||
/// </summary> | ||
public CanConfirmRegistrationProcedure() | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Prepares, validates, and executes the function "account.can_confirm_registration(_token uuid)" on the database. | ||
/// </summary> | ||
/// <param name="token">Enter argument value for "_token" parameter of the function "account.can_confirm_registration".</param> | ||
public CanConfirmRegistrationProcedure(System.Guid token) | ||
{ | ||
this.Token = token; | ||
} | ||
/// <summary> | ||
/// Prepares and executes the function "account.can_confirm_registration". | ||
/// </summary> | ||
/// <exception cref="UnauthorizedException">Thown when the application user does not have sufficient privilege to perform this action.</exception> | ||
public bool Execute() | ||
{ | ||
if (!this.SkipValidation) | ||
{ | ||
if (!this.Validated) | ||
{ | ||
this.Validate(AccessTypeEnum.Execute, this._LoginId, this._Catalog, false); | ||
} | ||
if (!this.HasAccess) | ||
{ | ||
Log.Information("Access to the function \"CanConfirmRegistrationProcedure\" was denied to the user with Login ID {LoginId}.", this._LoginId); | ||
throw new UnauthorizedException("Access is denied."); | ||
} | ||
} | ||
string query = "SELECT * FROM account.can_confirm_registration(@Token);"; | ||
|
||
query = query.ReplaceWholeWord("@Token", "@0::uuid"); | ||
|
||
|
||
List<object> parameters = new List<object>(); | ||
parameters.Add(this.Token); | ||
|
||
return Factory.Scalar<bool>(this._Catalog, query, parameters.ToArray()); | ||
} | ||
|
||
|
||
} | ||
} |
77 changes: 77 additions & 0 deletions
77
src/Frapid.Web/Areas/Frapid.Account/DataAccess/CanRegisterWithFacebookProcedure.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
// ReSharper disable All | ||
using Npgsql; | ||
using Serilog; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Frapid.Account.Entities; | ||
using Frapid.DataAccess; | ||
using Frapid.DataAccess.Models; | ||
using Frapid.DbPolicy; | ||
using Frapid.Framework.Extensions; | ||
namespace Frapid.Account.DataAccess | ||
{ | ||
/// <summary> | ||
/// Prepares, validates, and executes the function "account.can_register_with_facebook()" on the database. | ||
/// </summary> | ||
public class CanRegisterWithFacebookProcedure : DbAccess, ICanRegisterWithFacebookRepository | ||
{ | ||
/// <summary> | ||
/// The schema of this PostgreSQL function. | ||
/// </summary> | ||
public override string _ObjectNamespace => "account"; | ||
/// <summary> | ||
/// The schema unqualified name of this PostgreSQL function. | ||
/// </summary> | ||
public override string _ObjectName => "can_register_with_facebook"; | ||
/// <summary> | ||
/// Login id of application user accessing this PostgreSQL function. | ||
/// </summary> | ||
public long _LoginId { get; set; } | ||
/// <summary> | ||
/// User id of application user accessing this table. | ||
/// </summary> | ||
public int _UserId { get; set; } | ||
/// <summary> | ||
/// The name of the database on which queries are being executed to. | ||
/// </summary> | ||
public string _Catalog { get; set; } | ||
|
||
|
||
/// <summary> | ||
/// Prepares, validates, and executes the function "account.can_register_with_facebook()" on the database. | ||
/// </summary> | ||
public CanRegisterWithFacebookProcedure() | ||
{ | ||
} | ||
/// <summary> | ||
/// Prepares and executes the function "account.can_register_with_facebook". | ||
/// </summary> | ||
/// <exception cref="UnauthorizedException">Thown when the application user does not have sufficient privilege to perform this action.</exception> | ||
public bool Execute() | ||
{ | ||
if (!this.SkipValidation) | ||
{ | ||
if (!this.Validated) | ||
{ | ||
this.Validate(AccessTypeEnum.Execute, this._LoginId, this._Catalog, false); | ||
} | ||
if (!this.HasAccess) | ||
{ | ||
Log.Information("Access to the function \"CanRegisterWithFacebookProcedure\" was denied to the user with Login ID {LoginId}.", this._LoginId); | ||
throw new UnauthorizedException("Access is denied."); | ||
} | ||
} | ||
string query = "SELECT * FROM account.can_register_with_facebook();"; | ||
|
||
|
||
|
||
|
||
List<object> parameters = new List<object>(); | ||
|
||
return Factory.Scalar<bool>(this._Catalog, query, parameters.ToArray()); | ||
} | ||
|
||
|
||
} | ||
} |
77 changes: 77 additions & 0 deletions
77
src/Frapid.Web/Areas/Frapid.Account/DataAccess/CanRegisterWithGoogleProcedure.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
// ReSharper disable All | ||
using Npgsql; | ||
using Serilog; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Frapid.Account.Entities; | ||
using Frapid.DataAccess; | ||
using Frapid.DataAccess.Models; | ||
using Frapid.DbPolicy; | ||
using Frapid.Framework.Extensions; | ||
namespace Frapid.Account.DataAccess | ||
{ | ||
/// <summary> | ||
/// Prepares, validates, and executes the function "account.can_register_with_google()" on the database. | ||
/// </summary> | ||
public class CanRegisterWithGoogleProcedure : DbAccess, ICanRegisterWithGoogleRepository | ||
{ | ||
/// <summary> | ||
/// The schema of this PostgreSQL function. | ||
/// </summary> | ||
public override string _ObjectNamespace => "account"; | ||
/// <summary> | ||
/// The schema unqualified name of this PostgreSQL function. | ||
/// </summary> | ||
public override string _ObjectName => "can_register_with_google"; | ||
/// <summary> | ||
/// Login id of application user accessing this PostgreSQL function. | ||
/// </summary> | ||
public long _LoginId { get; set; } | ||
/// <summary> | ||
/// User id of application user accessing this table. | ||
/// </summary> | ||
public int _UserId { get; set; } | ||
/// <summary> | ||
/// The name of the database on which queries are being executed to. | ||
/// </summary> | ||
public string _Catalog { get; set; } | ||
|
||
|
||
/// <summary> | ||
/// Prepares, validates, and executes the function "account.can_register_with_google()" on the database. | ||
/// </summary> | ||
public CanRegisterWithGoogleProcedure() | ||
{ | ||
} | ||
/// <summary> | ||
/// Prepares and executes the function "account.can_register_with_google". | ||
/// </summary> | ||
/// <exception cref="UnauthorizedException">Thown when the application user does not have sufficient privilege to perform this action.</exception> | ||
public bool Execute() | ||
{ | ||
if (!this.SkipValidation) | ||
{ | ||
if (!this.Validated) | ||
{ | ||
this.Validate(AccessTypeEnum.Execute, this._LoginId, this._Catalog, false); | ||
} | ||
if (!this.HasAccess) | ||
{ | ||
Log.Information("Access to the function \"CanRegisterWithGoogleProcedure\" was denied to the user with Login ID {LoginId}.", this._LoginId); | ||
throw new UnauthorizedException("Access is denied."); | ||
} | ||
} | ||
string query = "SELECT * FROM account.can_register_with_google();"; | ||
|
||
|
||
|
||
|
||
List<object> parameters = new List<object>(); | ||
|
||
return Factory.Scalar<bool>(this._Catalog, query, parameters.ToArray()); | ||
} | ||
|
||
|
||
} | ||
} |
Oops, something went wrong.