();
+//
+//
+// for ( PolicyWrapper policy : policies ) {
+// sortedPolicies.add(policy);
+// }
+//
+// int start, end;
+// end = 0;
+// boolean added = true;
+//
+// while (added) {
+// start = end;
+// end = sortedPolicies.size();
+// for (int i = start; i < end; ++i) {
+// for ( PolicyWrapper refines : sortedPolicies.get(i).getRefinesWrappers()) {
+// if ( ! policies.contains(refines) ) {
+// sortedPolicies.add(refines);
+// policies.add(refines);
+// added = true;
+// }
+// }
+// }
+// }
+// return sortedPolicies;
+// }
+
+}
diff --git a/src/ch/ethz/infsec/secureumlgui/modelmapping/permissions/PermissionSet.java b/src/ch/ethz/infsec/secureumlgui/modelmapping/permissions/PermissionSet.java
new file mode 100644
index 0000000..1bf0fd1
--- /dev/null
+++ b/src/ch/ethz/infsec/secureumlgui/modelmapping/permissions/PermissionSet.java
@@ -0,0 +1,78 @@
+/**
+ *
+ */
+package ch.ethz.infsec.secureumlgui.modelmapping.permissions;
+
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import ch.ethz.infsec.secureumlgui.wrapper.RoleWrapper;
+
+/**
+ * A mapping from Roles to {@link ResourcePermissionsSet}s. In the
+ * end, this gives a mapping from roles and actions to the list of
+ * permissions the role has for the action.
+ *
+ *
+ * PermissionSet
+ *
+ * ||
+ *
+ * Role -> {@link ResourcePermissionsSet}
+ *
+ * ||
+ *
+ * Action -> {@link ActionPermissionSet}
+ *
+ * ||
+ *
+ * List<{@link PermissionValue}>
+ * {@link RoleWrapper}
+ * {@link ch.ethz.infsec.secureumlgui.wrapper.ActionWrapper}
+ *
+ *
+ */
+public class PermissionSet
+{
+ Map