This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes security-role Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "security-role" Watch "security-role" New topic
Author

security-role

Dhruvi Manchanda
Greenhorn

Joined: Mar 20, 2007
Posts: 15
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.


Dhruvi<br /> <br />SCJP 1.4,SCWCD
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

if it is * then everyone is allowed.

So why do you think that B is incorrect ?


[My Blog]
All roads lead to JavaRanch
Dhruvi Manchanda
Greenhorn

Joined: Mar 20, 2007
Posts: 15
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

Joined: Nov 24, 2005
Posts: 14688
    
  16

The security role declared here is only "Member", and the "*" constraint allows this role (and other as well)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: security-role