This commit is contained in:
@@ -81,7 +81,7 @@ namespace AyaNova.Api.Controllers
|
||||
LocaleKeysToFetch.Add("UserTypesAdministrator");
|
||||
LocaleKeysToFetch.Add("UserTypesSchedulable");
|
||||
LocaleKeysToFetch.Add("UserTypesNonSchedulable");
|
||||
LocaleKeysToFetch.Add("UserTypesClient");
|
||||
LocaleKeysToFetch.Add("UserTypesCustomer");
|
||||
LocaleKeysToFetch.Add("UserTypesHeadOffice");
|
||||
LocaleKeysToFetch.Add("UserTypesSubContractor");
|
||||
var LT = LocaleBiz.GetSubsetStatic(LocaleKeysToFetch, LocaleId).Result;
|
||||
@@ -89,7 +89,7 @@ namespace AyaNova.Api.Controllers
|
||||
ReturnList.Add(new NameIdItem() { Name = LT["UserTypesAdministrator"], Id = (long)UserType.Administrator });
|
||||
ReturnList.Add(new NameIdItem() { Name = LT["UserTypesSchedulable"], Id = (long)UserType.Schedulable });
|
||||
ReturnList.Add(new NameIdItem() { Name = LT["UserTypesNonSchedulable"], Id = (long)UserType.NonSchedulable });
|
||||
ReturnList.Add(new NameIdItem() { Name = LT["UserTypesClient"], Id = (long)UserType.Client });
|
||||
ReturnList.Add(new NameIdItem() { Name = LT["UserTypesCustomer"], Id = (long)UserType.Customer });
|
||||
ReturnList.Add(new NameIdItem() { Name = LT["UserTypesHeadOffice"], Id = (long)UserType.HeadOffice });
|
||||
ReturnList.Add(new NameIdItem() { Name = LT["UserTypesSubContractor"], Id = (long)UserType.Subcontractor });
|
||||
}
|
||||
@@ -110,8 +110,8 @@ namespace AyaNova.Api.Controllers
|
||||
LocaleKeysToFetch.Add("AuthorizationRoleTechFull");
|
||||
LocaleKeysToFetch.Add("AuthorizationRoleSubContractorLimited");
|
||||
LocaleKeysToFetch.Add("AuthorizationRoleSubContractorFull");
|
||||
LocaleKeysToFetch.Add("AuthorizationRoleClientLimited");
|
||||
LocaleKeysToFetch.Add("AuthorizationRoleClientFull");
|
||||
LocaleKeysToFetch.Add("AuthorizationRoleCustomerLimited");
|
||||
LocaleKeysToFetch.Add("AuthorizationRoleCustomerFull");
|
||||
LocaleKeysToFetch.Add("AuthorizationRoleOpsAdminLimited");
|
||||
LocaleKeysToFetch.Add("AuthorizationRoleOpsAdminFull");
|
||||
LocaleKeysToFetch.Add("AuthorizationRoleSalesLimited");
|
||||
@@ -131,8 +131,8 @@ namespace AyaNova.Api.Controllers
|
||||
ReturnList.Add(new NameIdItem() { Name = LT["AuthorizationRoleTechFull"], Id = (long)AuthorizationRoles.TechFull });
|
||||
ReturnList.Add(new NameIdItem() { Name = LT["AuthorizationRoleSubContractorLimited"], Id = (long)AuthorizationRoles.SubContractorLimited });
|
||||
ReturnList.Add(new NameIdItem() { Name = LT["AuthorizationRoleSubContractorFull"], Id = (long)AuthorizationRoles.SubContractorFull });
|
||||
ReturnList.Add(new NameIdItem() { Name = LT["AuthorizationRoleClientLimited"], Id = (long)AuthorizationRoles.ClientLimited });
|
||||
ReturnList.Add(new NameIdItem() { Name = LT["AuthorizationRoleClientFull"], Id = (long)AuthorizationRoles.ClientFull });
|
||||
ReturnList.Add(new NameIdItem() { Name = LT["AuthorizationRoleCustomerLimited"], Id = (long)AuthorizationRoles.CustomerLimited });
|
||||
ReturnList.Add(new NameIdItem() { Name = LT["AuthorizationRoleCustomerFull"], Id = (long)AuthorizationRoles.CustomerFull });
|
||||
ReturnList.Add(new NameIdItem() { Name = LT["AuthorizationRoleOpsAdminLimited"], Id = (long)AuthorizationRoles.OpsAdminLimited });
|
||||
ReturnList.Add(new NameIdItem() { Name = LT["AuthorizationRoleOpsAdminFull"], Id = (long)AuthorizationRoles.OpsAdminFull });
|
||||
ReturnList.Add(new NameIdItem() { Name = LT["AuthorizationRoleSalesLimited"], Id = (long)AuthorizationRoles.SalesLimited });
|
||||
|
||||
@@ -165,7 +165,7 @@ namespace AyaNova.Api.Controllers
|
||||
//Instantiate the business object handler
|
||||
DataListFilterBiz biz = DataListFilterBiz.GetBiz(ct, HttpContext);
|
||||
|
||||
//If a user has change roles, or editOwnRoles then they can create, true is passed for isOwner since they are creating so by definition the owner
|
||||
//check roles
|
||||
if (!Authorized.HasCreateRole(HttpContext.Items, biz.BizType))
|
||||
return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user