def migrate_permission_settings(self):
        """Migrate permission settings (permission <-> role)

        The acquire flag is coded into the type of the sequence. If roles is a list
        than the roles are also acquire. If roles is a tuple the roles aren't
        acquired.
        """
        _marker = []

        oldmap = self.ac_inherited_permissions
        newmap = getPermissionMapping(self.new.ac_inherited_permissions(1))
        for key, values in oldmap.items():
            old_p = Permission(key, values, self.old)
            old_roles = old_p.getRoles(default=_marker)
            if old_roles is _marker:
                continue
            new_values = newmap.get(key, ())
            new_p = Permission(key, new_values, self.new)
            new_p.setRoles(old_roles)
示例#2
0
    def migrate_permission_settings(self):
        """Migrate permission settings (permission <-> role)

        The acquire flag is coded into the type of the sequence. If roles is a list
        than the roles are also acquire. If roles is a tuple the roles aren't
        acquired.
        """
        _marker = []

        oldmap = self.ac_inherited_permissions
        newmap = getPermissionMapping(self.new.ac_inherited_permissions(1))
        for key, values in oldmap.items():
            old_p = Permission(key, values, self.old)
            old_roles = old_p.getRoles(default=_marker)
            if old_roles is _marker:
                continue
            new_values = newmap.get(key, ())
            new_p = Permission(key, new_values, self.new)
            new_p.setRoles(old_roles)
 def beforeChange_permission_settings(self):
     """Load permission settings (permission <-> role)."""
     self._checkLoadAttr('ac_inherited_permissions')
     self.ac_inherited_permissions = getPermissionMapping(
         self.old.ac_inherited_permissions(1))
示例#4
0
 def beforeChange_permission_settings(self):
     """Load permission settings (permission <-> role)."""
     self._checkLoadAttr('ac_inherited_permissions')
     self.ac_inherited_permissions = getPermissionMapping(
         self.old.ac_inherited_permissions(1))