/** * Checks whether the condition may change during the lifetime of the UserPromptCondition object. * This depends on the permission level given in * {@link UserPromptCondition#getCondition(Bundle, ConditionInfo)}. * <ul> * <li>ONESHOT - true</li> * <li>SESSION - true, if the application model's session lifetime is * shorter than the UserPromptCondition object lifetime</li> * <li>BLANKET - false</li> * </ul> * If the system supports separately accessible permission management GUI, * then this function may also return true for SESSION and BLANKET. * * @return True, if the condition can change. */ public boolean isMutable() { lookForImplementation(); if (realUserPromptCondition!=null) { return realUserPromptCondition.isMutable(); } else { // since we don't know what the actual status is, we cannot say // "the condition cannot change anymore" return true; } }
private boolean checkMutable(BundlePermissions bundlePermissions, EvaluationCacheKey evaluationCacheKey, SecurityRow row) { Condition[] conditions = row.getConditions(bundlePermissions); if (conditions != null) { for (Condition condition : conditions) { if (condition != null && condition.isMutable()) { evaluationCache.put(evaluationCacheKey, MUTABLE); return true; } } } return false; }
private int getPostponedDecision(Decision decision, Map<Class<? extends Condition>, Dictionary<Object, Object>> conditionDictionaries, CheckContext cc) { Condition[] postponed = decision.postponed; for (int i = 0; i < postponed.length; i++) { Dictionary<Object, Object> condContext = conditionDictionaries.get(postponed[i].getClass()); if (condContext == null) { condContext = new Hashtable<Object, Object>(); conditionDictionaries.put(postponed[i].getClass(), condContext); } // prevent recursion into Condition if (cc.CondClassSet == null) cc.CondClassSet = new ArrayList<Class<?>>(2); if (cc.CondClassSet.contains(postponed[i].getClass())) return SecurityTable.ABSTAIN; cc.CondClassSet.add(postponed[i].getClass()); try { // must call isMutable before calling isSatisfied according to the specification boolean mutable = postponed[i].isMutable(); boolean isSatisfied = postponed[i].isSatisfied(new Condition[] {postponed[i]}, condContext); decision.handleImmutable(postponed[i], isSatisfied, mutable); if (!isSatisfied) return SecurityTable.ABSTAIN; } finally { cc.CondClassSet.remove(postponed[i].getClass()); } } // call postponed conditions are satisfied return the decision return decision.decision; }
private int getPostponedDecision(Decision decision, Map<Class<? extends Condition>, Dictionary<Object, Object>> conditionDictionaries, CheckContext cc) { Condition[] postponed = decision.postponed; for (int i = 0; i < postponed.length; i++) { Dictionary<Object, Object> condContext = conditionDictionaries.get(postponed[i].getClass()); if (condContext == null) { condContext = new Hashtable<Object, Object>(); conditionDictionaries.put(postponed[i].getClass(), condContext); } // prevent recursion into Condition if (cc.CondClassSet == null) cc.CondClassSet = new ArrayList<Class<?>>(2); if (cc.CondClassSet.contains(postponed[i].getClass())) return SecurityTable.ABSTAIN; cc.CondClassSet.add(postponed[i].getClass()); try { // must call isMutable before calling isSatisfied according to the specification boolean mutable = postponed[i].isMutable(); boolean isSatisfied = postponed[i].isSatisfied(new Condition[] {postponed[i]}, condContext); decision.handleImmutable(postponed[i], isSatisfied, mutable); if (!isSatisfied) return SecurityTable.ABSTAIN; } finally { cc.CondClassSet.remove(postponed[i].getClass()); } } // call postponed conditions are satisfied return the decision return decision.decision; }
private int getPostponedDecision(Decision decision, Map<Class<? extends Condition>, Dictionary<Object, Object>> conditionDictionaries, CheckContext cc) { Condition[] postponed = decision.postponed; for (int i = 0; i < postponed.length; i++) { Dictionary<Object, Object> condContext = conditionDictionaries.get(postponed[i].getClass()); if (condContext == null) { condContext = new Hashtable<Object, Object>(); conditionDictionaries.put(postponed[i].getClass(), condContext); } // prevent recursion into Condition if (cc.CondClassSet == null) cc.CondClassSet = new ArrayList<Class<?>>(2); if (cc.CondClassSet.contains(postponed[i].getClass())) return SecurityTable.ABSTAIN; cc.CondClassSet.add(postponed[i].getClass()); try { // must call isMutable before calling isSatisfied according to the specification boolean mutable = postponed[i].isMutable(); boolean isSatisfied = postponed[i].isSatisfied(new Condition[] {postponed[i]}, condContext); decision.handleImmutable(postponed[i], isSatisfied, mutable); if (!isSatisfied) return SecurityTable.ABSTAIN; } finally { cc.CondClassSet.remove(postponed[i].getClass()); } } // call postponed conditions are satisfied return the decision return decision.decision; }
private int getPostponedDecision(Decision decision, Map<Class<? extends Condition>, Dictionary<Object, Object>> conditionDictionaries, CheckContext cc) { Condition[] postponed = decision.postponed; for (int i = 0; i < postponed.length; i++) { Dictionary<Object, Object> condContext = conditionDictionaries.get(postponed[i].getClass()); if (condContext == null) { condContext = new Hashtable<Object, Object>(); conditionDictionaries.put(postponed[i].getClass(), condContext); } // prevent recursion into Condition if (cc.CondClassSet == null) cc.CondClassSet = new ArrayList<Class<?>>(2); if (cc.CondClassSet.contains(postponed[i].getClass())) return SecurityTable.ABSTAIN; cc.CondClassSet.add(postponed[i].getClass()); try { // must call isMutable before calling isSatisfied according to the specification boolean mutable = postponed[i].isMutable(); boolean isSatisfied = postponed[i].isSatisfied(new Condition[] {postponed[i]}, condContext); decision.handleImmutable(postponed[i], isSatisfied, mutable); if (!isSatisfied) return SecurityTable.ABSTAIN; } finally { cc.CondClassSet.remove(postponed[i].getClass()); } } // call postponed conditions are satisfied return the decision return decision.decision; }
private int getPostponedDecision(Decision decision, Map<Class<? extends Condition>, Dictionary<Object, Object>> conditionDictionaries, CheckContext cc) { Condition[] postponed = decision.postponed; for (int i = 0; i < postponed.length; i++) { Dictionary<Object, Object> condContext = conditionDictionaries.get(postponed[i].getClass()); if (condContext == null) { condContext = new Hashtable<Object, Object>(); conditionDictionaries.put(postponed[i].getClass(), condContext); } // prevent recursion into Condition if (cc.CondClassSet == null) cc.CondClassSet = new ArrayList<Class<?>>(2); if (cc.CondClassSet.contains(postponed[i].getClass())) return SecurityTable.ABSTAIN; cc.CondClassSet.add(postponed[i].getClass()); try { // must call isMutable before calling isSatisfied according to the specification boolean mutable = postponed[i].isMutable(); boolean isSatisfied = postponed[i].isSatisfied(new Condition[] {postponed[i]}, condContext); decision.handleImmutable(postponed[i], isSatisfied, mutable); if (!isSatisfied) return SecurityTable.ABSTAIN; } finally { cc.CondClassSet.remove(postponed[i].getClass()); } } // call postponed conditions are satisfied return the decision return decision.decision; }
private int getPostponedDecision(Decision decision, Map<Class<? extends Condition>, Dictionary<Object, Object>> conditionDictionaries, CheckContext cc) { Condition[] postponed = decision.postponed; for (int i = 0; i < postponed.length; i++) { Dictionary<Object, Object> condContext = conditionDictionaries.get(postponed[i].getClass()); if (condContext == null) { condContext = new Hashtable<>(); conditionDictionaries.put(postponed[i].getClass(), condContext); } // prevent recursion into Condition if (cc.CondClassSet == null) cc.CondClassSet = new ArrayList<>(2); if (cc.CondClassSet.contains(postponed[i].getClass())) return SecurityTable.ABSTAIN; cc.CondClassSet.add(postponed[i].getClass()); try { // must call isMutable before calling isSatisfied according to the specification boolean mutable = postponed[i].isMutable(); boolean isSatisfied = postponed[i].isSatisfied(new Condition[] {postponed[i]}, condContext); decision.handleImmutable(postponed[i], isSatisfied, mutable); if (!isSatisfied) return SecurityTable.ABSTAIN; } finally { cc.CondClassSet.remove(postponed[i].getClass()); } } // call postponed conditions are satisfied return the decision return decision.decision; }
private int getPostponedDecision(Decision decision, Map<Class<? extends Condition>, Dictionary<Object, Object>> conditionDictionaries, CheckContext cc) { Condition[] postponed = decision.postponed; for (int i = 0; i < postponed.length; i++) { Dictionary<Object, Object> condContext = conditionDictionaries.get(postponed[i].getClass()); if (condContext == null) { condContext = new Hashtable<Object, Object>(); conditionDictionaries.put(postponed[i].getClass(), condContext); } // prevent recursion into Condition if (cc.CondClassSet == null) cc.CondClassSet = new ArrayList<Class<?>>(2); if (cc.CondClassSet.contains(postponed[i].getClass())) return SecurityTable.ABSTAIN; cc.CondClassSet.add(postponed[i].getClass()); try { // must call isMutable before calling isSatisfied according to the specification boolean mutable = postponed[i].isMutable(); boolean isSatisfied = postponed[i].isSatisfied(new Condition[] {postponed[i]}, condContext); decision.handleImmutable(postponed[i], isSatisfied, mutable); if (!isSatisfied) return SecurityTable.ABSTAIN; } finally { cc.CondClassSet.remove(postponed[i].getClass()); } } // call postponed conditions are satisfied return the decision return decision.decision; }
private int getPostponedDecision(Decision decision, Map<Class<? extends Condition>, Dictionary<Object, Object>> conditionDictionaries, CheckContext cc) { Condition[] postponed = decision.postponed; for (int i = 0; i < postponed.length; i++) { Dictionary<Object, Object> condContext = conditionDictionaries.get(postponed[i].getClass()); if (condContext == null) { condContext = new Hashtable<>(); conditionDictionaries.put(postponed[i].getClass(), condContext); } // prevent recursion into Condition if (cc.CondClassSet == null) cc.CondClassSet = new ArrayList<>(2); if (cc.CondClassSet.contains(postponed[i].getClass())) return SecurityTable.ABSTAIN; cc.CondClassSet.add(postponed[i].getClass()); try { // must call isMutable before calling isSatisfied according to the specification boolean mutable = postponed[i].isMutable(); boolean isSatisfied = postponed[i].isSatisfied(new Condition[] {postponed[i]}, condContext); decision.handleImmutable(postponed[i], isSatisfied, mutable); if (!isSatisfied) return SecurityTable.ABSTAIN; } finally { cc.CondClassSet.remove(postponed[i].getClass()); } } // call postponed conditions are satisfied return the decision return decision.decision; }
final boolean m = c.isMutable(); if (c.isSatisfied(new Condition [] {c}, d)) { if (!m) {
final boolean mutable = c.isMutable(); if (c.isSatisfied()) { if (!mutable) {
if (!isPostponed(condition)) { boolean mutable = condition.isMutable(); if (condition.isSatisfied()) { if (!mutable)
if (!isPostponed(condition)) { boolean mutable = condition.isMutable(); if (condition.isSatisfied()) { if (!mutable)
if (!isPostponed(condition)) { boolean mutable = condition.isMutable(); if (condition.isSatisfied()) { if (!mutable)
if (!isPostponed(condition)) { boolean mutable = condition.isMutable(); if (condition.isSatisfied()) { if (!mutable)
if (!isPostponed(condition)) { boolean mutable = condition.isMutable(); if (condition.isSatisfied()) { if (!mutable)
if (!isPostponed(condition)) { boolean mutable = condition.isMutable(); if (condition.isSatisfied()) { if (!mutable)
if (!isPostponed(condition)) { boolean mutable = condition.isMutable(); if (condition.isSatisfied()) { if (!mutable)
if (!isPostponed(condition)) { boolean mutable = condition.isMutable(); if (condition.isSatisfied()) { if (!mutable)