mirror of
https://github.com/ansible/awx.git
synced 2026-03-05 10:41:05 -03:30
REST access for job template detail, access to read one follows whether permissions are available. Access to see
them should similarly follow (pending).
This commit is contained in:
@@ -767,6 +767,16 @@ class JobTemplate(CommonModel):
|
||||
import lib.urls
|
||||
return reverse(lib.urls.views_JobTemplateDetail, args=(self.pk,))
|
||||
|
||||
@classmethod
|
||||
def can_user_read(cls, user, obj):
|
||||
# you can only see the job templates that you have permission to launch.
|
||||
data = dict(
|
||||
inventory = obj.inventory.pk,
|
||||
project = obj.project.pk,
|
||||
job_type = obj.job_type
|
||||
)
|
||||
return cls.can_user_add(user, data)
|
||||
|
||||
@classmethod
|
||||
def can_user_add(cls, user, data):
|
||||
'''
|
||||
|
||||
Reference in New Issue
Block a user