Skip to content
This repository was archived by the owner on Sep 6, 2019. It is now read-only.

Commit

Permalink
Merge restrictions
Browse files Browse the repository at this point in the history
Refs #1700
  • Loading branch information
M66B committed Jun 3, 2014
1 parent fca5632 commit 8799b1c
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/biz/bokhorst/xprivacy/PrivacyManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,13 @@ public static void applyTemplate(int uid, String restrictionName, boolean method
+ "+ask", false);
boolean parentRestricted = parentValue.contains("true");
boolean parentAsked = (!ondemand || parentValue.contains("asked"));
if (!clear) {
PRestriction parentMerge = getRestrictionEx(uid, rRestrictionName, null);
if (parentMerge.restricted)
parentRestricted = true;
if (!parentMerge.asked)
parentAsked = false;
}
listPRestriction.add(new PRestriction(uid, rRestrictionName, null, parentRestricted, parentAsked));

// Childs
Expand All @@ -470,7 +477,15 @@ public static void applyTemplate(int uid, String restrictionName, boolean method
+ (parentAsked ? "+asked" : "+ask"), false);
boolean restricted = value.contains("true");
boolean asked = (!ondemand || value.contains("asked"));
if ((parentRestricted && !restricted) || (!parentAsked && asked) || hook.whitelist() != null)
if (!clear) {
PRestriction childMerge = getRestrictionEx(uid, rRestrictionName, hook.getName());
if (childMerge.restricted)
restricted = true;
if (!childMerge.asked)
asked = false;
}
if ((parentRestricted && !restricted) || (!parentAsked && asked) || hook.whitelist() != null
|| !clear)
listPRestriction.add(new PRestriction(uid, rRestrictionName, hook.getName(), parentRestricted
&& restricted, parentAsked || asked));
}
Expand Down

0 comments on commit 8799b1c

Please sign in to comment.