• 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

How can i implement security in field level

 
Ranch Hand
Posts: 620
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all

i need to find the best way to implement some kind of way security in the field level that means

to be able to determine if some combo box or text box can be edit or modified by some user according to som rules

it needs to be before the elements renders to the page ( can it be done by filters ? )

im using jsp and tomcat
 
Ranch Hand
Posts: 472
Objective C Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It was discussed here. It can be done by filter if you wrap up a response and will provide your output stream which will control HTML content and cut protected elements. However this approach looks a bit complicated for me.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds like a simple application of <c:if> on the JSP pages that render the HTML to me.
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can have a format (probably a xml structure) that would map user to the input elements that is unprotected for him for a particular page.Now you can write a taglib , that will make use of this xml to decide whether the field to be rendered should be protected or unprotected for this user.
In this way you will develope a complete infrastructure for handling this issue in the application.
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would go with Bear. Other options are just too much of work.
 
ben josh
Ranch Hand
Posts: 620
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all and thanks for the fast reply
filters is the answer indid but im trying to find implement it in as much as less painful way .
that is im trying to avoid adding ( surrounding ) the html elements with <c:if > and such . i have 600 pages
what im thinking about is ( i dont know if it can be done ) to add some function or some other thing to each html element
this function or indicator will be checked by the filter before it renders to the output . so all the logic will be in the filter side
and it be written once .
can it be done ?
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Meir Yan:
what im thinking about is ( i dont know if it can be done ) to add some function or some other thing to each html element
this function or indicator will be checked by the filter before it renders to the output . so all the logic will be in the filter side
and it be written once .
can it be done ?



It reminds me a custom JSF component I made for some similar kind of thing. Anyway, you can achieve this kind of behavior using custom tag. Filter is not the best solution here, I believe.
 
ben josh
Ranch Hand
Posts: 620
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply
well i cant do jsf because i dont have jsf only jsp but can you or someone please give me example code or some thing
to go from there ? for me to understand ?
 
Yeah, but does being a ninja come with a dental plan? And what about this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic