Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to restrict access to pages for dynamically generated menu based on roles

How to restrict access to pages for dynamically generated menu based on roles

Scheduled Pinned Locked Moved ASP.NET
databasehelptutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sishya
    wrote on last edited by
    #1

    Hi all, I have created a web control which dynamically creates menu based on the session set (ex: Session["empid"]=8} .Based on this session id the database is queried and appropriate menu items are displayed.But although the menu item link is not displayed for the user who has no authority to access a page ,if the user knows the url to a page which he is not supposed to view and types in,he can easily get access to the page .Is there any way out of this.Is there a way to dynamically configure at runtime in such a way that acess to pages for certain session id's can be restricted.Please help me out guys Thanks in advance, beadarsh

    Z 1 Reply Last reply
    0
    • S sishya

      Hi all, I have created a web control which dynamically creates menu based on the session set (ex: Session["empid"]=8} .Based on this session id the database is queried and appropriate menu items are displayed.But although the menu item link is not displayed for the user who has no authority to access a page ,if the user knows the url to a page which he is not supposed to view and types in,he can easily get access to the page .Is there any way out of this.Is there a way to dynamically configure at runtime in such a way that acess to pages for certain session id's can be restricted.Please help me out guys Thanks in advance, beadarsh

      Z Offline
      Z Offline
      Zafar Iqbal
      wrote on last edited by
      #2

      Hi, Create a base page and inherit all your pages from that page. And in this base page implement your security logic, that the requested pageid matches with current session's employee priviliges or not, and if not then redirect him to login page or display any unauthorization message. Regards Ghuna Singh

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups