• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Cobian Q41 Doubts

 
Ranch Hand
Posts: 1551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Q 41 Given the following declaration
<security-role-ref>
<role-link>linkedRole</role-link>
<role-name>roleName</role-name>
</security-role-ref>
Which method call is correct?
1) isUserInRole(linkedRole)
2) isUserInRole(roleName)
Cobian says answer is 2.
From Sun's Tutorial
Sun J2EE TUTORIAL Security
In this example, isUserInRole("bankCustomer") and isUserInRole("cust") will both return true for the methods indicated in the Method Permissions pane.
I am thinking answer is 1 and 2. Any one have a different opinion?
 
Ranch Hand
Posts: 765
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where can i get Cobian's Mock?
Bye.
Viki.
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I believe that the role-link represents the user that is in "Code", where as the role-name is the role-name used in the web.xml under security-role tag, which is not assessible from your servlet code.
I might be wrong.
Mark
 
Ranch Hand
Posts: 2166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mark.
I say: You are right.
With this
<security-role-ref>
<role-name>roleInCode</role-name>
<role-link>roleInTomcat-users.xml</role-link>
</security-role-ref>

construct,
the deployer can use different role-names from those chosen by the programmer.
not 100% sure. Correct me if I am wrong.
Axel
[ February 27, 2002: Message edited by: Axel Janssen ]
 
Ranch Hand
Posts: 776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Rufus Bugleweed:
Q 41 Given the following declaration
<security-role-ref>
<role-link>linkedRole</role-link>
<role-name>roleName</role-name>
</security-role-ref>
Which method call is correct?
1) isUserInRole(linkedRole)
2) isUserInRole(roleName)
Cobian says answer is 2.
From Sun's Tutorial
Sun J2EE TUTORIAL Security
In this example, isUserInRole("bankCustomer") and isUserInRole("cust") will both return true for the methods indicated in the Method Permissions pane.
I am thinking answer is 1 and 2. Any one have a different opinion?



Seems to me, if that is exactly the question from the mock, then you do not answer it, because the correct answer is "none of the above". There will be a parse exception at container start, because the role-link and role-name tags are reversed from the DTD specified order.
G.
 
Rufus BugleWeed
Ranch Hand
Posts: 1551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In response to

Where can i get Cobian's Mock?

It's on the SCWCD links page.
To the others, thanks for your input.
[ February 28, 2002: Message edited by: Rufus Bugleweed ]
 
"How many licks ..." - I think all of this dog's research starts with these words. Tasty tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic