Filter criteria according to the get variable user/* have allowed certain roles user pages to been seen by an anonymous user. I have then created a block that displays the latest post of the role user pages.

Is there a way in views to create a filter criteria from the get variable of the anonymous users URL

For example user/30 profile page is requested from the anonymous user. The view gets the id 30 from the url and then sorts the posts in the block view according to that users id

Below I have added some images on the view. 

When an anonymous user accesses the authors user profile via the url it needs to display the content the author has created in the block view. The block itself only displays on the user pages by the use of user/* in the block configuration.

I hope this helps thanks again
Here are the steps to achieve your requirement

Go to view and add contextual filter User: uid



Then select 'Provide default value' and select Type : 'Raw value from URL' and Path component: 2 (as URL is user/* .we select second component to get User ID)



That's it. I've tested this and working perfect.

Hope it helps.