How to grant permission for a user to access SQL Jobs?
User does not have access to SQL Agent, SQL Jobs to run the Job.
I would say this is "well" documented in Configure a User to Create and Manage SQL Server Agent Jobs, however, "well" would seem to be a bit much; perhaps "touched on" is a better phrase. It does, however, give you the basicsl that there are database roles in msdb that can be used to give the user/login permissions.
If your login doesn't already have a user in msdb first you'll need to create them one:
CREATE USER [YourLogin] FOR LOGIN [YourLogin];
Then you need to provide them with the correct fixed roles; there are 3 of these SQLAgentOperatorRole, SQLAgentReaderRole and SQLAgentUserRole. These are better covered in SQL Server Agent Fixed Database Roles. Then you simply need to use the relevant ALTER command. For example:
USE msdb;
ALTER ROLE SQLAgentReaderRole ADD MEMBER [YourLogin];
To quote the relevant permissions of each role:
SQL Agent User Role:
SQLAgentUserRole is the least privileged of the SQL Server Agent fixed database roles. It has permissions on only operators, local jobs, and job schedules. Members of SQLAgentUserRole have permissions on only local jobs and job schedules that they own. They cannot use multiserver jobs (master and target server jobs), and they cannot change job ownership to gain access to jobs that they do not already own. SQLAgentUserRole members can view a list of available proxies only in the Job Step Properties dialog box of SQL Server Management Studio. Only the Jobs node in SQL Server Management Studio Object Explorer is visible to members of SQLAgentUserRole.
SQL Agent Reader Role:
SQLAgentReaderRole includes all the SQLAgentUserRole permissions as well as permissions to view the list of available multiserver jobs, their properties, and their history. Members of this role can also view the list of all available jobs and job schedules and their properties, not just those jobs and job schedules that they own. SQLAgentReaderRole members cannot change job ownership to gain access to jobs that they do not already own. Only the Jobs node in SQL Server Management Studio Object Explorer is visible to members of the SQLAgentReaderRole.
SQL Agent Operator Role:
SQLAgentOperatorRole is the most privileged of the SQL Server Agent fixed database roles. It includes all the permissions of SQLAgentUserRole and SQLAgentReaderRole. Members of this role can also view properties for operators and proxies, and enumerate available proxies and alerts on the server.
SQLAgentOperatorRole members have additional permissions on local jobs and schedules. They can execute, stop, or start all local jobs, and they can delete the job history for any local job on the server. They can also enable or disable all local jobs and schedules on the server. To enable or disable local jobs or schedules, members of this role must use the stored procedures sp_update_job and sp_update_schedule. Only the parameters that specify the job or schedule name or identifier and the @enabled parameter can be specified by members of SQLAgentOperatorRole. If they specify any other parameters, execution of these stored procedures fails. SQLAgentOperatorRole members cannot change job ownership to gain access to jobs that they do not already own.
The Jobs, Alerts, Operators, and Proxies nodes in SQL Server Management Studio Object Explorer are visible to members of SQLAgentOperatorRole. Only the Error Logs node is not visible to members of this role.
Depending on what actions the user needs to make depends on what role(s) the user needs. you can give the user multiple roles, if needed as well. None of the roles have explicit DENY permissions, so won't stop them from being able to perform specific task; they only enable them to do them.
msdb.dbo.sysjobs,msdb.dbo.sysjobsteps.