Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed errors in roles.txt and permissions
- Loading branch information
Showing
5 changed files
with
35 additions
and
5 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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Director: EmployeeRead | ||
AreaManager: StockRead, SalesRead | ||
SalesAssistant: StockRead, SalesRead, SalesSell | ||
SalesAssistant: StockRead, SalesSell | ||
StoreManager: StockRead, StockAddNew, StockRemove, SalesRead, SalesSell, SalesReturn | ||
UserAdmin: UserRead, UserChange, RoleRead |
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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Director: EmployeeRead | ||
AreaManager: StockRead, SalesRead | ||
SalesAssistant: StockRead, SalesRead, SalesSell | ||
SalesAssistant: StockRead, SalesSell | ||
StoreManager: StockRead, StockAddNew, StockRemove, SalesRead, SalesSell, SalesReturn | ||
UserAdmin: UserRead, UserChange, RoleRead |
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,27 @@ | ||
// Copyright (c) 2019 Jon P Smith, GitHub: JonPSmith, web: http://www.thereformedprogrammer.net/ | ||
// Licensed under MIT license. See License.txt in the project root for license information. | ||
|
||
using System; | ||
using System.Linq; | ||
using PermissionParts; | ||
using Xunit; | ||
using Xunit.Extensions.AssertExtensions; | ||
|
||
namespace Test.UnitTests.SecurityChecks | ||
{ | ||
public class CheckPermissions | ||
{ | ||
//Its VERY important that you don't have duplicate Permission numbers as it could cause a security breach | ||
[Fact] | ||
public void CheckPermissionsHaveUniqueNumberOk() | ||
{ | ||
//SETUP | ||
|
||
//ATTEMPT | ||
var nums = Enum.GetValues(typeof(Permissions)).Cast<Permissions>().Select(x => (int)x).ToList(); | ||
|
||
//VERIFY | ||
nums.Count.ShouldEqual(nums.Distinct().Count()); | ||
} | ||
} | ||
} |