This commit is contained in:
@@ -714,6 +714,25 @@ namespace AyaNova.Biz
|
|||||||
AddError(ApiErrorCode.VALIDATION_NOT_UNIQUE, "Login");
|
AddError(ApiErrorCode.VALIDATION_NOT_UNIQUE, "Login");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//SUPERUSER ACCOUNT CAN"T BE MODIFIED IN SOME WAYS
|
||||||
|
if(!isNew && proposedObj.Id==1){
|
||||||
|
//prevent certain changes to superuser account like roles etc
|
||||||
|
|
||||||
|
if(proposedObj.Roles!=currentObj.Roles)
|
||||||
|
AddError(ApiErrorCode.NOT_AUTHORIZED, "Roles");
|
||||||
|
|
||||||
|
if(proposedObj.Active!=currentObj.Active)
|
||||||
|
AddError(ApiErrorCode.NOT_AUTHORIZED, "Active");
|
||||||
|
|
||||||
|
if(proposedObj.Name!=currentObj.Name)
|
||||||
|
AddError(ApiErrorCode.NOT_AUTHORIZED, "Name");
|
||||||
|
|
||||||
|
if(proposedObj.UserType!=currentObj.UserType)
|
||||||
|
AddError(ApiErrorCode.NOT_AUTHORIZED, "UserType");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//TODO: Validation rules that require future other objects that aren't present yet:
|
//TODO: Validation rules that require future other objects that aren't present yet:
|
||||||
/*
|
/*
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user