EtchUK / Etch.OrchardCore.ContentPermissions

Module for Orchard Core to enable configuring access at a content item level.
MIT License
25 stars 6 forks source link

Support ~/-based redirect #9

Open Piedone opened 4 years ago

Piedone commented 4 years ago

It seems to me that if a tenant URL prefix is configured then that should be included in the redirect URL, making the DB not portable between environments if the prefix is different (or doesn't exist). Adding support for tilde-prefixed URLs would solve this. E.g. "~/" would redirect to the tenant's homepage, regardless it having a URL prefix or not.

peterkeating commented 4 years ago

Currently the tenant URL prefix is always added to the redirect URL. Do you think we should make it only include the tenant prefix if the redirect URL is prefixed with "~/"? Definitely worth including a hint to state relative URLs will be prefixed with tenant URL prefixed.

Piedone commented 4 years ago

Ah I see. I think the tilde notation as used throughout ASP.NET and in other parts of Orchard too is a more generic approach (it would also open up the option to not use it deliberately but I don't think that would be a popular use-case).

peterkeating commented 4 years ago

Agreed it wouldn't be a common use case but if I wanted to redirect to another site (e.g. https://google.co.uk) then currently the code would try to redirect to /tenant-prefix/https://google.co.uk, so that definitely needs resolving. I'll also make sure the tilde is supported too 👍

Piedone commented 4 years ago

Great, thank you!