Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

security-role

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HFSJ final mock question 43:

<security-role>
<role-name>Member</role-name>
</security-role>

Which are valid <auth-constraint> elements that will allow users to access resources constrained by the security role declared?

A. <auth-constraint/>
B. <auth-constraint>*</auth-constraint>
C. <auth-constraint>Member</auth-constraint>
D. <auth-constraint>MEMBER</auth-constraint>
E. <auth-constraint>"Member"</auth-constraint>

The answer given is B and C. How is option B correct ?

As per my understanding, security-role may mention n-number of roles, but only those listed in auth-constriant can make a constrained request for that resource. If no member is listed by auth-constraint then no one can make constrained request and if it is * then everyone is allowed.

Please correct me if I am wrong.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

if it is * then everyone is allowed.


So why do you think that B is incorrect ?
 
Dhruvi Manchanda
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Satou,

I got confused with this line

allow users to access resources constrained by the security role declared



Does that mean if ever allowed users are asked then it will include all the roles from scurity role plus everyone i.e *.

Thanks
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The security role declared here is only "Member", and the "*" constraint allows this role (and other as well)
    Bookmark Topic Watch Topic
  • New Topic