676 // choose the target: if the target does not include wildcards, |
676 // choose the target: if the target does not include wildcards, |
677 // then there must be an exact match between the requested |
677 // then there must be an exact match between the requested |
678 // permission and the policy permission |
678 // permission and the policy permission |
679 String target = legacyPermission.getTarget(); |
679 String target = legacyPermission.getTarget(); |
680 if (target != null |
680 if (target != null |
681 && target.indexOf("*") == -1 |
681 && !("*".equals(policyPermissions[i].getTarget())) |
682 && !target.equals(policyPermissions[i].getTarget())) |
682 && !target.equals(policyPermissions[i].getTarget())) |
683 { |
683 { |
684 continue; |
684 continue; |
|
685 } |
|
686 if (target == null) |
|
687 { |
|
688 target = policyPermissions[i].getTarget(); |
685 } |
689 } |
686 // choose the action |
690 // choose the action |
687 String actionList = legacyPermission.getActionList(); |
691 String actionList = legacyPermission.getActionList(); |
688 if (actionList == null) |
692 if (actionList == null) |
689 { |
693 { |
690 resolvedPermissions.addElement( |
694 resolvedPermissions.addElement( |
691 new PolicyBasedPermissionImpl( |
695 new PolicyBasedPermissionImpl( |
692 policyPermissions[i].getName(), |
696 policyPermissions[i].getName(), |
693 policyPermissions[i].getTarget(), |
697 target, |
694 policyPermissions[i].getActionList(), |
698 policyPermissions[i].getActionList(), |
695 policyPermissions[i].getUserSecuritySettings())); |
699 policyPermissions[i].getUserSecuritySettings())); |
696 } |
700 } |
697 else |
701 else |
698 { |
702 { |
700 policyPermissions[i].getActionList())) |
704 policyPermissions[i].getActionList())) |
701 { |
705 { |
702 resolvedPermissions.addElement( |
706 resolvedPermissions.addElement( |
703 new PolicyBasedPermissionImpl( |
707 new PolicyBasedPermissionImpl( |
704 policyPermissions[i].getName(), |
708 policyPermissions[i].getName(), |
705 policyPermissions[i].getTarget(), |
709 target, |
706 actionList, |
710 actionList, |
707 policyPermissions[i].getUserSecuritySettings())); |
711 policyPermissions[i].getUserSecuritySettings())); |
708 } |
712 } |
709 } |
713 } |
710 } |
714 } |