public boolean isSatisfied(Condition[] conds, Dictionary<Object, Object> context) { for (int i = 0, length = conds.length; i < length; i++) { if (!conds[i].isSatisfied()) return false; } return true; } }
/** * Checks an array of UserPrompt conditions. * * @param conds The array containing the UserPrompt conditions to evaluate. * @param context Storage area for evaluation. The {@link org.osgi.service.condpermadmin.ConditionalPermissionAdmin} * may evaluate a condition several times for one permission check, so this context * will be used to store results of ONESHOT questions. This way asking the same question * twice in a row can be avoided. If context is null, temporary results will not be stored. * @return True, if all conditions are satisfied. * @throws NullPointerException if conds is null. */ public boolean isSatisfied(Condition[] conds, Dictionary context) { lookForImplementation(); if (realUserPromptCondition!=null) { return realUserPromptCondition.isSatisfied(conds,context); } else { // paranoid security option return false; } } }
/** * Displays the prompt string to * the user and returns true if the user accepts. Depending on the * amount of levels the condition is assigned to, the prompt may have * multiple accept buttons and one of them can be selected by default (see * default level parameter at {@link UserPromptCondition#getCondition(Bundle, ConditionInfo)}). * It must always be possible for the user * to stop further prompting of this question, even with ONESHOT and SESSION levels. * In case of BLANKET * and SESSION levels, it is possible that the user has already answered the question, * in this case there will be no prompting, but immediate return with the previous answer. * * @return True if the user accepts the prompt (or accepts any prompt in * case there are multiple permission levels). */ public boolean isSatisfied() { lookForImplementation(); if (realUserPromptCondition!=null) { return realUserPromptCondition.isSatisfied(); } else { // paranoid security option return false; } }
@Override public boolean isSatisfied(Condition[] conds, Dictionary<Object, Object> context) { for (int i = 0, length = conds.length; i < length; i++) { if (!conds[i].isSatisfied()) return false; } return true; } }
public boolean isSatisfied(Condition[] conds, Dictionary<Object, Object> context) { for (int i = 0, length = conds.length; i < length; i++) { if (!conds[i].isSatisfied()) return false; } return true; } }
public boolean isSatisfied(Condition[] conds, Dictionary<Object, Object> context) { for (int i = 0, length = conds.length; i < length; i++) { if (!conds[i].isSatisfied()) return false; } return true; } }
public boolean isSatisfied(Condition[] conds, Dictionary<Object, Object> context) { for (int i = 0, length = conds.length; i < length; i++) { if (!conds[i].isSatisfied()) return false; } return true; } }
public boolean isSatisfied(Condition[] conds, Dictionary<Object, Object> context) { for (int i = 0, length = conds.length; i < length; i++) { if (!conds[i].isSatisfied()) return false; } return true; } }
public boolean isSatisfied(Condition[] conds, Dictionary<Object, Object> context) { for (int i = 0, length = conds.length; i < length; i++) { if (!conds[i].isSatisfied()) return false; } return true; } }
public boolean isSatisfied(Condition[] conds, Dictionary<Object, Object> context) { for (int i = 0, length = conds.length; i < length; i++) { if (!conds[i].isSatisfied()) return false; } return true; } }
public boolean isSatisfied(Condition[] conds, Dictionary<Object, Object> context) { for (int i = 0, length = conds.length; i < length; i++) { if (!conds[i].isSatisfied()) return false; } return true; } }
public boolean isSatisfied(Condition[] conds, Dictionary<Object, Object> context) { for (int i = 0, length = conds.length; i < length; i++) { if (!conds[i].isSatisfied()) return false; } return true; } }
@Override public boolean isSatisfied(Condition[] conds, Dictionary<Object, Object> context) { for (int i = 0, length = conds.length; i < length; i++) { if (!conds[i].isSatisfied()) return false; } return true; } }
public boolean isSatisfied(Condition[] conds, Dictionary<Object, Object> context) { for (int i = 0, length = conds.length; i < length; i++) { if (!conds[i].isSatisfied()) return false; } return true; } }
public boolean isSatisfied(Condition[] conds, Dictionary<Object, Object> context) { for (int i = 0, length = conds.length; i < length; i++) { if (!conds[i].isSatisfied()) return false; } return true; } }
/** * Returns whether the specified set of Condition objects are satisfied. Although this method is * not static, it must be implemented as if it were static. All of the passed Condition objects * will be of the same type and will correspond to the class type of the object on which this * method is invoked. This method must be called inside a permission check only. * * @param conditions The array of Condition objects, which must all be of the same class and * mutable. The receiver must be one of those Condition objects. * @param context A Dictionary object that implementors can use to track state. If this method is * invoked multiple times in the same permission check, the same Dictionary will be passed * multiple times. The SecurityManager treats this Dictionary as an opaque object and simply * creates an empty dictionary and passes it to subsequent invocations if multiple invocations * are needed. * @return {@code true} if all the Condition objects are satisfied. Otherwise, {@code false} if * one of the Condition objects is not satisfied. */ @Override public boolean isSatisfied(Condition[] conditions, Dictionary<Object, Object> context) { for (Condition condition : conditions) { if (!condition.isSatisfied()) { return false; } } return true; } }
public boolean matchDNChain(String pattern) { if (contributor == null) return false; return BundleSignerCondition.getCondition(contributor, new ConditionInfo(BundleSignerCondition.class.getName(), new String[] {pattern})).isSatisfied(); }
public boolean matchDNChain(String pattern) { if (contributor == null) return false; return BundleSignerCondition.getCondition(contributor, new ConditionInfo(BundleSignerCondition.class.getName(), new String[] {pattern})).isSatisfied(); }
@Override public boolean matchDNChain(String pattern) { if (contributor == null) return false; return BundleSignerCondition.getCondition(contributor, new ConditionInfo(BundleSignerCondition.class.getName(), new String[] {pattern})).isSatisfied(); }
@Descriptor("list all system permissions applying to a bundle") public List<ConditionalPermissionInfo> bundlePermissions(Bundle b) { final ConditionalPermissionUpdate cpu = cpa.newConditionalPermissionUpdate(); List<ConditionalPermissionInfo> l = new ArrayList<>(); for (ConditionalPermissionInfo cpi : cpu.getConditionalPermissionInfos()) { ConditionInfo[] cis = cpi.getConditionInfos(); for (ConditionInfo ci : cis) { if (ci.getType().equals("org.osgi.service.condpermadmin.BundleLocationCondition")) { Condition blc = BundleLocationCondition.getCondition(b, ci); if (blc.isSatisfied()) { l.add(cpi); } } } if (cis.length == 0) { l.add(cpi); } } return l; }