Get your CodeRanch badge!*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 14687
    
  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: 14687
    
  16

The security role declared here is only "Member", and the "*" constraint allows this role (and other as well)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: security-role
 
Similar Threads
HFSJ Final Mock Question 43
Doubt in Auth-Constraint
HFJS (V2) Final Mock Question 11 is wrong?
Doubts: Mock by HFSJ 1st Edt
authorization question (role names)