I'm build a angular/springboot fullstack project with mongodb. But I have a security issue regarding access to data that doesn't belong to the current user. For example if I have an url /mydata/123 then the current user could use a random id in url like /mydata/7865 and access to data that doesn't belong to him.
here a data model example :
mydatamodel {
id
criticaldata
}
How to avoid this usecase and what are the best practises to do this, please. Thanks.