@classmethod
def set_permission(cls, store, profile, app, permission):
    """
        Set the permission for a user profile to use a application
        :param store: a store
        :param profile: a UserProfile
        :param app: name of the application
        :param permission: a boolean of the permission
        """
    setting = store.find(cls, user_profile=profile, app_dir_name=app).one()
    setting.has_permission = permission
