'Validate SQL Server database backup path permission programatically before performing backup

I worked on a screen from which we can save the backup directory (C:\Program Files\Microsoft SQL Server\MSSQL12.SQLEXPRESS\MSSQL\Backup) to be able to perform backups later manually by clicking on a 'Perform backup' button.

My issue is that I want to validate the path permission when I save the path in my screen. My application runs on a different server where the database is set up. The only way I see to be able to validate the path permission for a distributed server is by performing the backup (ugly way) and if SQL Server does not have the permissions, an error is displayed.

Is there a SQL Server stored procedure that can validate if we have the permissions to make a backup to a specific path? Or any easier way to validate this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source