Restrict a document path from Backend in Sitefinity site










2















I need to add a Restrict on a document file path accessed from Sitefinity if there is no value in session.
I have an URL to documents stored in CMS like below




"~/docs/default-source/documentlibraryname/documentname.doc"




I Need to do some restriction in code when I try to access any direct path from Sitefinity.



public override RouteData GetRouteData(HttpContextBase httpContext)

var virtualPath = base.GetVirtualPathInternal(httpContext);



It's only giving ~/favicon.icon in virtualPath so cant get specific URL. I have tried Httphandler and also SitefinityRoute implementations for the same.



If anyone has any suggestions please help.










share|improve this question
























  • Maybe it will be easier to just set the Permissions on this document for Authenticated users for instance?

    – Veselin Vasilev
    Oct 10 '18 at 18:03











  • Thanks for your comment, but this is a path accessible by anyone who is not a backend user.

    – lakshmi prakasan
    Oct 11 '18 at 6:28















2















I need to add a Restrict on a document file path accessed from Sitefinity if there is no value in session.
I have an URL to documents stored in CMS like below




"~/docs/default-source/documentlibraryname/documentname.doc"




I Need to do some restriction in code when I try to access any direct path from Sitefinity.



public override RouteData GetRouteData(HttpContextBase httpContext)

var virtualPath = base.GetVirtualPathInternal(httpContext);



It's only giving ~/favicon.icon in virtualPath so cant get specific URL. I have tried Httphandler and also SitefinityRoute implementations for the same.



If anyone has any suggestions please help.










share|improve this question
























  • Maybe it will be easier to just set the Permissions on this document for Authenticated users for instance?

    – Veselin Vasilev
    Oct 10 '18 at 18:03











  • Thanks for your comment, but this is a path accessible by anyone who is not a backend user.

    – lakshmi prakasan
    Oct 11 '18 at 6:28













2












2








2








I need to add a Restrict on a document file path accessed from Sitefinity if there is no value in session.
I have an URL to documents stored in CMS like below




"~/docs/default-source/documentlibraryname/documentname.doc"




I Need to do some restriction in code when I try to access any direct path from Sitefinity.



public override RouteData GetRouteData(HttpContextBase httpContext)

var virtualPath = base.GetVirtualPathInternal(httpContext);



It's only giving ~/favicon.icon in virtualPath so cant get specific URL. I have tried Httphandler and also SitefinityRoute implementations for the same.



If anyone has any suggestions please help.










share|improve this question
















I need to add a Restrict on a document file path accessed from Sitefinity if there is no value in session.
I have an URL to documents stored in CMS like below




"~/docs/default-source/documentlibraryname/documentname.doc"




I Need to do some restriction in code when I try to access any direct path from Sitefinity.



public override RouteData GetRouteData(HttpContextBase httpContext)

var virtualPath = base.GetVirtualPathInternal(httpContext);



It's only giving ~/favicon.icon in virtualPath so cant get specific URL. I have tried Httphandler and also SitefinityRoute implementations for the same.



If anyone has any suggestions please help.







c# asp.net-mvc httphandler sitefinity-5






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 '18 at 11:57









Blanko

122114




122114










asked Oct 10 '18 at 7:10









lakshmi prakasanlakshmi prakasan

320412




320412












  • Maybe it will be easier to just set the Permissions on this document for Authenticated users for instance?

    – Veselin Vasilev
    Oct 10 '18 at 18:03











  • Thanks for your comment, but this is a path accessible by anyone who is not a backend user.

    – lakshmi prakasan
    Oct 11 '18 at 6:28

















  • Maybe it will be easier to just set the Permissions on this document for Authenticated users for instance?

    – Veselin Vasilev
    Oct 10 '18 at 18:03











  • Thanks for your comment, but this is a path accessible by anyone who is not a backend user.

    – lakshmi prakasan
    Oct 11 '18 at 6:28
















Maybe it will be easier to just set the Permissions on this document for Authenticated users for instance?

– Veselin Vasilev
Oct 10 '18 at 18:03





Maybe it will be easier to just set the Permissions on this document for Authenticated users for instance?

– Veselin Vasilev
Oct 10 '18 at 18:03













Thanks for your comment, but this is a path accessible by anyone who is not a backend user.

– lakshmi prakasan
Oct 11 '18 at 6:28





Thanks for your comment, but this is a path accessible by anyone who is not a backend user.

– lakshmi prakasan
Oct 11 '18 at 6:28












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52734582%2frestrict-a-document-path-from-backend-in-sitefinity-site%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52734582%2frestrict-a-document-path-from-backend-in-sitefinity-site%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

Barbados

How to read a connectionString WITH PROVIDER in .NET Core?

Node.js Script on GitHub Pages or Amazon S3