About Question enthuware.jwpv6.2.894 :

Moderator: admin

Post Reply
basamajoe
Posts: 21
Joined: Fri Apr 26, 2013 3:40 am
Contact:

About Question enthuware.jwpv6.2.894 :

Post by basamajoe »

if(request.isUserInRole("boss"))
{
// other valid code
}

I think I am missing something, the code // other valid code is executed when the if condition is true.

Code: Select all

boolean isUserInRole(java.lang.String role)
Returns a boolean indicating whether the authenticated user is included in the specified logical "role". Roles and role membership can be defined using deployment descriptors. If the user has not been authenticated, the method returns false.
The code // other valid code will be executed only when boss user is in role.

And the answer would be 'At //other valid code, the user would be in "boss" role.', doesn't it?

admin
Site Admin
Posts: 10046
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.894 :

Post by admin »

Please go through the explanation. It explains exactly what you are asking.
If you like our products and services, please help us by posting your review here.

himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.894 :

Post by himaiMinh »

For this question, from the developer's perspective, the user is in boss role in //other valid code .
But from the deployer's perspective, the user is in manager role.
I assume the question is asking what the role is from the deployer's perspective.

admin
Site Admin
Posts: 10046
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.894 :

Post by admin »

That is correct. Role from the developer's perspective is obviously "boss" because that is what the code is checking.
-Paul.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 33 guests