The largest Interview Solution Library on the web


java tutorials/
« Previous | 1 | 2 | 3 | Next »

Authorization - Permissions


  • Class1.methodA calls

  • Class2.methodB

ProtectionDomain for Class1 = { P1, P3 }

ProtectionDomain for Class2 = { P2, P3 }

checkPermission(P1) fails

checkPermission(P2) fails

checkPermission(P3) succeeds

  • Class1.methodA calls

  • Class2.methodB

  • Calls AccessController.doPrivileged()

  • Class2.methodC

ProtectionDomain for Class1 = { P1, P3 }

ProtectionDomain for Class2 = { P2, P3 }

checkPermission(P1) fails

checkPermission(P2) succeeds

checkPermission(P3) succeeds

  • Class1.methodA calls

  • doPrivileged(AccessControlContext({P3,P4}))

  • calls

  • Class2.methodB

ProtectionDomain for Class1 = { P1, P3 } AccessControlContext = {P3, P4}

ProtectionDomain for Class2 = { P2, P3 }

checkPermission(P3) succeeds

All others fail.
« Previous | 1 | 2 | 3 | Next »


copyright © 2014 - all rights riserved by javatechnologycenter.com