Restrict the list of parent pages

– Is it possible to restrict the list of parent pages available for selection from dropdown menu at “Pages Attributes” of Page Editor for the selected role?
– Is there a way to only display selected pages in the “Page Attributes > Parent dropdown menu” for the selected user role?
We have the positive answer. Use a piece of code below for your pleasure:

Just replace ‘editor’ with your own role name and add this code to your active theme functions.php or install as a must-use plugin.