Page 1 of 1

About Question enthuware.jwpv6.2.894 :

Posted: Tue Jul 16, 2013 5:44 am
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?

Re: About Question enthuware.jwpv6.2.894 :

Posted: Tue Jul 16, 2013 6:43 am
by admin
Please go through the explanation. It explains exactly what you are asking.

Re: About Question enthuware.jwpv6.2.894 :

Posted: Sun May 01, 2016 5:43 pm
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.

Re: About Question enthuware.jwpv6.2.894 :

Posted: Sun May 01, 2016 8:18 pm
by admin
That is correct. Role from the developer's perspective is obviously "boss" because that is what the code is checking.
-Paul.