module PermissionsModule
    use SimulationVariables
    implicit none
    
contains
    subroutine Set_SwingTiltPermission(v)
        implicit none
        logical , intent(in) :: v
        #ifdef ExcludeExtraChanges
            if(data%State%permissions%SwingTiltPermission == v) return
        #endif
        data%State%permissions%SwingTiltPermission = v
        #ifdef deb
            print*, 'data%State%permissions%SwingTiltPermission=', data%State%permissions%SwingTiltPermission
        #endif
        !**call data%State%permissions%OnSwingTiltPermissionChange%RunAll()
    end subroutine

    logical function Get_SwingTiltPermission()
        implicit none
        Get_SwingTiltPermission = data%State%permissions%SwingTiltPermission
    end function

    subroutine Set_SwingOffPermission(v)
        implicit none
        logical , intent(in) :: v
        #ifdef ExcludeExtraChanges
            if(data%State%permissions%SwingOffPermission == v) return
        #endif
        data%State%permissions%SwingOffPermission = v
        #ifdef deb
            print*, 'data%State%permissions%SwingOffPermission=', data%State%permissions%SwingOffPermission
        #endif
        !**call data%State%permissions%OnSwingOffPermissionChange%RunAll()
    end subroutine

    logical function Get_SwingOffPermission()
        implicit none
        Get_SwingOffPermission = data%State%permissions%SwingOffPermission
    end function

    subroutine Set_SwingDrillPermission(v)
        implicit none
        logical , intent(in) :: v
        #ifdef ExcludeExtraChanges
            if(data%State%permissions%SwingDrillPermission == v) return
        #endif
        data%State%permissions%SwingDrillPermission = v
        #ifdef deb
            print*, 'data%State%permissions%SwingDrillPermission=', data%State%permissions%SwingDrillPermission
        #endif
        !**call data%State%permissions%OnSwingDrillPermissionChange%RunAll()
    end subroutine

    logical function Get_SwingDrillPermission()
        implicit none
        Get_SwingDrillPermission = data%State%permissions%SwingDrillPermission
    end function

    subroutine Set_RemoveMudBucketPermission(v)
        implicit none
        logical , intent(in) :: v
        #ifdef ExcludeExtraChanges
            if(data%State%permissions%RemoveMudBucketPermission == v) return
        #endif
        data%State%permissions%RemoveMudBucketPermission = v
        #ifdef deb
            print*, 'data%State%permissions%RemoveMudBucketPermission=', data%State%permissions%RemoveMudBucketPermission
        #endif
        !**call data%State%permissions%OnRemoveMudBucketPermissionChange%RunAll()
    end subroutine

    logical function Get_RemoveMudBucketPermission()
        implicit none
        Get_RemoveMudBucketPermission = data%State%permissions%RemoveMudBucketPermission
    end function


    subroutine Set_RemoveFillupHeadPermission(v)
        implicit none
        logical , intent(in) :: v
        #ifdef ExcludeExtraChanges
            if(data%State%permissions%RemoveFillupHeadPermission == v) return
        #endif
        data%State%permissions%RemoveFillupHeadPermission = v
        #ifdef deb
            print*, 'data%State%permissions%RemoveFillupHeadPermission=', data%State%permissions%RemoveFillupHeadPermission
        #endif
        !**call data%State%permissions%OnRemoveFillupHeadPermissionChange%RunAll()
    end subroutine

    logical function Get_RemoveFillupHeadPermission()
        implicit none
        Get_RemoveFillupHeadPermission = data%State%permissions%RemoveFillupHeadPermission
    end function

    subroutine Set_IrSafetyValvePermission(v)
        implicit none
        logical , intent(in) :: v
        #ifdef ExcludeExtraChanges
            if(data%State%permissions%IrSafetyValvePermission == v) return
        #endif
        data%State%permissions%IrSafetyValvePermission = v
        #ifdef deb
            print*, 'data%State%permissions%IrSafetyValvePermission=', data%State%permissions%IrSafetyValvePermission
        #endif
        !**call data%State%permissions%OnIrSafetyValvePermissionChange%RunAll()
    end subroutine

    logical function Get_IrSafetyValvePermission()
        implicit none
        Get_IrSafetyValvePermission = data%State%permissions%IrSafetyValvePermission
    end function

    subroutine Set_IrIbopPermission(v)
        implicit none
        logical , intent(in) :: v
        #ifdef ExcludeExtraChanges
            if(data%State%permissions%IrIbopPermission == v) return
        #endif
        data%State%permissions%IrIbopPermission = v
        #ifdef deb
            print*, 'data%State%permissions%IrIbopPermission=', data%State%permissions%IrIbopPermission
        #endif
        !**call data%State%permissions%OnIrIbopPermissionChange%RunAll()
    end subroutine

    logical function Get_IrIbopPermission()
        implicit none
        Get_IrIbopPermission = data%State%permissions%IrIbopPermission
    end function


    subroutine Set_InstallMudBucketPermission(v)
        implicit none
        logical , intent(in) :: v
        #ifdef ExcludeExtraChanges
            if(data%State%permissions%InstallMudBucketPermission == v) return
        #endif
        data%State%permissions%InstallMudBucketPermission = v
        #ifdef deb
            print*, 'data%State%permissions%InstallMudBucketPermission=', data%State%permissions%InstallMudBucketPermission
        #endif
        !**call data%State%permissions%OnInstallMudBucketPermissionChange%RunAll()
    end subroutine

    logical function Get_InstallMudBucketPermission()
        implicit none
        Get_InstallMudBucketPermission = data%State%permissions%InstallMudBucketPermission
    end function

    subroutine Set_InstallFillupHeadPermission(v)
        implicit none
        logical , intent(in) :: v
        #ifdef ExcludeExtraChanges
        if(data%State%permissions%InstallFillupHeadPermission == v) return
        #endif
        data%State%permissions%InstallFillupHeadPermission = v
        #ifdef deb
        print*, 'InstallFillupHeadPermission=', data%State%permissions%InstallFillupHeadPermission
        #endif
        !**call data%State%permissions%OnInstallFillupHeadPermissionChange%RunAll()
    end subroutine

    logical function Get_InstallFillupHeadPermission()
        implicit none
        Get_InstallFillupHeadPermission = data%State%permissions%InstallFillupHeadPermission
    end function

    subroutine Set_FillupHeadPermission(v)
        implicit none
        logical , intent(in) :: v
        #ifdef ExcludeExtraChanges
        if(data%State%permissions%FillupHeadPermission == v) return
        #endif
        data%State%permissions%FillupHeadPermission = v
        #ifdef deb
        print*, 'FillupHeadPermission=', data%State%permissions%FillupHeadPermission
        #endif
        !**call data%State%permissions%OnFillupHeadPermissionChange%RunAll()
    end subroutine

    logical function Get_FillupHeadPermission()
        implicit none
        Get_FillupHeadPermission = data%State%permissions%FillupHeadPermission
    end function

end module PermissionsModule