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 && !("*".equals(policyPermissions[i].getTarget())) |
681 && target.indexOf("*") == -1 |
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(); |
|
689 } |
685 } |
690 // choose the action |
686 // choose the action |
691 String actionList = legacyPermission.getActionList(); |
687 String actionList = legacyPermission.getActionList(); |
692 if (actionList == null) |
688 if (actionList == null) |
693 { |
689 { |
694 resolvedPermissions.addElement( |
690 resolvedPermissions.addElement( |
695 new PolicyBasedPermissionImpl( |
691 new PolicyBasedPermissionImpl( |
696 policyPermissions[i].getName(), |
692 policyPermissions[i].getName(), |
697 target, |
693 policyPermissions[i].getTarget(), |
698 policyPermissions[i].getActionList(), |
694 policyPermissions[i].getActionList(), |
699 policyPermissions[i].getUserSecuritySettings())); |
695 policyPermissions[i].getUserSecuritySettings())); |
700 } |
696 } |
701 else |
697 else |
702 { |
698 { |
704 policyPermissions[i].getActionList())) |
700 policyPermissions[i].getActionList())) |
705 { |
701 { |
706 resolvedPermissions.addElement( |
702 resolvedPermissions.addElement( |
707 new PolicyBasedPermissionImpl( |
703 new PolicyBasedPermissionImpl( |
708 policyPermissions[i].getName(), |
704 policyPermissions[i].getName(), |
709 target, |
705 policyPermissions[i].getTarget(), |
710 actionList, |
706 actionList, |
711 policyPermissions[i].getUserSecuritySettings())); |
707 policyPermissions[i].getUserSecuritySettings())); |
712 } |
708 } |
713 } |
709 } |
714 } |
710 } |