This commit is contained in:
@@ -641,6 +641,12 @@ A work order item can have zero to many separate Work order item task records as
|
|||||||
|
|
||||||
All Work order item Task edit form fields here are **optional** unless stated as required.
|
All Work order item Task edit form fields here are **optional** unless stated as required.
|
||||||
|
|
||||||
|
##### Restricted users and tasks
|
||||||
|
|
||||||
|
[Restricted Users](#limited-access-role-rights) are only permitted to make edits to Tasks that for which *they* are the selected User. Tasks for other Users can not be changed by a restricted User.
|
||||||
|
|
||||||
|
This means the restricted User *must* be pre-selected as the Task "User" by the person creating the work order item tasks or the restricted user will not be able to complete the Tasks.
|
||||||
|
|
||||||
#### Sequence
|
#### Sequence
|
||||||
|
|
||||||
This field is _required_ but is set automatically and can be manually changed.
|
This field is _required_ but is set automatically and can be manually changed.
|
||||||
|
|||||||
@@ -3925,18 +3925,23 @@ namespace AyaNova.Biz
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isNew && UserIsRestrictedType)
|
if (!isNew && UserIsRestrictedType && currentObj.CompletedByUserId != UserId)
|
||||||
{
|
{
|
||||||
//Existing record so just make sure they haven't changed the not changeable fields from the db version
|
//restricted users are not allowed to edit any task unless they are the selected User
|
||||||
|
AddError(ApiErrorCode.NOT_AUTHORIZED, "generalerror");
|
||||||
|
return;
|
||||||
|
|
||||||
//* Tasks: view and edit existing tasks, set completion type and date only, no add or remove or changing other fields
|
// //Existing record so just make sure they haven't changed the not changeable fields from the db version
|
||||||
//note that UI will prevent this, this rule is only backup for 3rd party api users
|
|
||||||
if (currentObj.Task != proposedObj.Task) AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "Task");
|
// //* Tasks: view and edit existing tasks, set completion type and date only, no add or remove or changing other fields
|
||||||
if (currentObj.CompletedByUserId != UserId) AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "CompletedByUserId");
|
// //note that UI will prevent this, this rule is only backup for 3rd party api users
|
||||||
if (currentObj.Sequence != proposedObj.Sequence) AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "Sequence");
|
// if (currentObj.Task != proposedObj.Task) AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "Task");
|
||||||
|
// if (currentObj.CompletedByUserId != UserId) AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "CompletedByUserId");
|
||||||
|
// if (currentObj.Sequence != proposedObj.Sequence) AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "Sequence");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(proposedObj.Task))
|
if (string.IsNullOrWhiteSpace(proposedObj.Task))
|
||||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Task");
|
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Task");
|
||||||
|
|
||||||
|
|||||||
@@ -4172,17 +4172,22 @@ namespace AyaNova.Biz
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isNew && UserIsRestrictedType)
|
if (!isNew && UserIsRestrictedType && currentObj.CompletedByUserId != UserId)
|
||||||
{
|
{
|
||||||
//Existing record so just make sure they haven't changed the not changeable fields from the db version
|
//restricted users are not allowed to edit any task unless they are the selected User
|
||||||
|
AddError(ApiErrorCode.NOT_AUTHORIZED, "generalerror");
|
||||||
|
return;
|
||||||
|
|
||||||
//* Tasks: view and edit existing tasks, set completion type and date only, no add or remove or changing other fields
|
// //Existing record so just make sure they haven't changed the not changeable fields from the db version
|
||||||
//note that UI will prevent this, this rule is only backup for 3rd party api users
|
|
||||||
if (currentObj.Task != proposedObj.Task) AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "Task");
|
// //* Tasks: view and edit existing tasks, set completion type and date only, no add or remove or changing other fields
|
||||||
if (currentObj.CompletedByUserId != UserId) AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "CompletedByUserId");
|
// //note that UI will prevent this, this rule is only backup for 3rd party api users
|
||||||
if (currentObj.Sequence != proposedObj.Sequence) AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "Sequence");
|
// if (currentObj.Task != proposedObj.Task) AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "Task");
|
||||||
|
// if (currentObj.CompletedByUserId != UserId) AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "CompletedByUserId");
|
||||||
|
// if (currentObj.Sequence != proposedObj.Sequence) AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "Sequence");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(proposedObj.Task))
|
if (string.IsNullOrWhiteSpace(proposedObj.Task))
|
||||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Task");
|
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Task");
|
||||||
|
|
||||||
|
|||||||
@@ -5768,15 +5768,20 @@ namespace AyaNova.Biz
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isNew && UserIsRestrictedType)
|
|
||||||
{
|
|
||||||
//Existing record so just make sure they haven't changed the not changeable fields from the db version
|
|
||||||
|
|
||||||
//* Tasks: view and edit existing tasks, set completion type and date only, no add or remove or changing other fields
|
if (!isNew && UserIsRestrictedType && currentObj.CompletedByUserId != UserId)
|
||||||
//note that UI will prevent this, this rule is only backup for 3rd party api users
|
{
|
||||||
if (currentObj.Task != proposedObj.Task) AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "Task");
|
//restricted users are not allowed to edit any task unless they are the selected User
|
||||||
if (currentObj.CompletedByUserId != UserId) AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "CompletedByUserId");
|
AddError(ApiErrorCode.NOT_AUTHORIZED, "generalerror");
|
||||||
if (currentObj.Sequence != proposedObj.Sequence) AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "Sequence");
|
return;
|
||||||
|
|
||||||
|
// //Existing record so just make sure they haven't changed the not changeable fields from the db version
|
||||||
|
|
||||||
|
// //* Tasks: view and edit existing tasks, set completion type and date only, no add or remove or changing other fields
|
||||||
|
// //note that UI will prevent this, this rule is only backup for 3rd party api users
|
||||||
|
// if (currentObj.Task != proposedObj.Task) AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "Task");
|
||||||
|
// if (currentObj.CompletedByUserId != UserId) AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "CompletedByUserId");
|
||||||
|
// if (currentObj.Sequence != proposedObj.Sequence) AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "Sequence");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user