'Sets the Perspective for the User'

def set_perspective(self, perspective):

    ModuleSetting.set_for_module('default_perspective', perspective.id, 'treeio.core', user=self)
    modules = (perspective.modules.all() or Module.objects.all())
    for module in modules:
        if (not self.has_permission(module)):
            module.read_access.add(self)
