• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Able/Disable hyperlinks based on Login(User Credentials)

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Help required
Is there any way so that we can able/disable particular links on a page based on login???
Page will be same for all types of users but hyperlinks shd be made active if the user has credentials of doing that work otherwise shd be visible but inactive.


Thanks in advance
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The server should not render them as links, that is the only secure way of doing it. Anyone that has any JavaScript knowledge can re-enable them and perform the action.

Eric
 
author & internet detective
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hemant,
Welcome to JavaRanch!

To expand on what Eric said, it's common to use your server side language to control this. In Java, that would be the JSP. You only write out the link if the user has permission. This also helps by not advertising to hackers what other functions they should try to attack.

Also, you should have another check on the server side to make sure the user has access and didn't just type in a URL.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic