roles update
This commit is contained in:
@@ -61,16 +61,19 @@ namespace Business.Business.UserManagment.Controllers
|
|||||||
|
|
||||||
public void CreateInitialRoles()
|
public void CreateInitialRoles()
|
||||||
{
|
{
|
||||||
var Admin = new Role("Admin");
|
|
||||||
var Manager = new Role("Manager");
|
|
||||||
var Cashier = new Role("Cashier");
|
var Cashier = new Role("Cashier");
|
||||||
context.Role.AddRange(Admin, Manager, Cashier);
|
var Manager = new Role("Manager");
|
||||||
|
var Admin = new Role("Admin");
|
||||||
|
context.Role.AddRange(Cashier, Manager, Admin);
|
||||||
context.SaveChanges();
|
context.SaveChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets All Roles
|
/// Gets All Roles.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Requires Admin role.
|
||||||
|
/// </remarks>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// Returns a ICollection of all roles
|
/// Returns a ICollection of all roles
|
||||||
/// </returns>
|
/// </returns>
|
||||||
@@ -90,10 +93,11 @@ namespace Business.Business.UserManagment.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Searches the role by given Id
|
/// Searches the role by given Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>
|
/// <remarks>
|
||||||
/// Returns an object of the role with the given Id
|
|
||||||
///
|
|
||||||
/// Requires Admin role.
|
/// Requires Admin role.
|
||||||
|
/// </remarks>
|
||||||
|
/// <returns>
|
||||||
|
/// Returns an object of the role with the given Id.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
|
|
||||||
public Role Get(int id)
|
public Role Get(int id)
|
||||||
@@ -111,10 +115,11 @@ namespace Business.Business.UserManagment.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Searches the role by given name
|
/// Searches the role by given name
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>
|
/// <remarks>
|
||||||
/// Returns an object of the role with the given name
|
|
||||||
///
|
|
||||||
/// Requires Admin role.
|
/// Requires Admin role.
|
||||||
|
/// </remarks>
|
||||||
|
/// <returns>
|
||||||
|
/// Returns an object of the role with the given name.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
|
|
||||||
public Role Get(string name)
|
public Role Get(string name)
|
||||||
@@ -132,10 +137,11 @@ namespace Business.Business.UserManagment.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Searches the role by a given substring
|
/// Searches the role by a given substring
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Requires Admin role.
|
||||||
|
/// </remarks>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// Returns an ICollection of all roles that contain the given substring in their name.
|
/// Returns an ICollection of all roles that contain the given substring in their name.
|
||||||
///
|
|
||||||
/// Requires Admin role.
|
|
||||||
/// </returns>
|
/// </returns>
|
||||||
|
|
||||||
public ICollection<Role> GetByApproximateName(string substring)
|
public ICollection<Role> GetByApproximateName(string substring)
|
||||||
|
|||||||
@@ -56,10 +56,11 @@ namespace Business.Business.UserManagment
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets All Users
|
/// Gets All Users
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Requires Admin role.
|
||||||
|
/// </remarks>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// Returns a ICollection of all users.
|
/// Returns a ICollection of all users.
|
||||||
///
|
|
||||||
/// Requires Admin role
|
|
||||||
/// </returns>
|
/// </returns>
|
||||||
|
|
||||||
public ICollection<User> GetAll()
|
public ICollection<User> GetAll()
|
||||||
@@ -92,6 +93,9 @@ namespace Business.Business.UserManagment
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Searches the user by given Id
|
/// Searches the user by given Id
|
||||||
|
/// <remarks>
|
||||||
|
/// Requires Admin role.
|
||||||
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// Returns an object of the user with the given Id
|
/// Returns an object of the user with the given Id
|
||||||
@@ -112,10 +116,11 @@ namespace Business.Business.UserManagment
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Searches the user by given name
|
/// Searches the user by given name
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Requires Admin role.
|
||||||
|
/// </remarks>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// Returns an object of the user with the given name.
|
/// Returns an object of the user with the given name.
|
||||||
///
|
|
||||||
/// Requires Admin role
|
|
||||||
/// </returns>
|
/// </returns>
|
||||||
|
|
||||||
public User Get(string name)
|
public User Get(string name)
|
||||||
@@ -133,10 +138,11 @@ namespace Business.Business.UserManagment
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Searches the user by a given substring
|
/// Searches the user by a given substring
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Requires Admin role.
|
||||||
|
/// </remarks>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// Returns an ICollection of all users that contain the given substring in their name.
|
/// Returns an ICollection of all users that contain the given substring in their name.
|
||||||
///
|
|
||||||
/// Requires Admin role
|
|
||||||
/// </returns>
|
/// </returns>
|
||||||
|
|
||||||
public ICollection<User> GetByApproximateName(string substring)
|
public ICollection<User> GetByApproximateName(string substring)
|
||||||
|
|||||||
Reference in New Issue
Block a user