Added utilities to serialize and deserialize permissions.