diff --git a/spug_api/apps/app/views.py b/spug_api/apps/app/views.py index 45aebdd..9fbbfe2 100644 --- a/spug_api/apps/app/views.py +++ b/spug_api/apps/app/views.py @@ -185,7 +185,7 @@ class DeployView(View): return json_response(error=error) -@auth('deploy.app.config') +@auth('deploy.app.config|deploy.repository.add|deploy.request.add|deploy.request.edit') def get_versions(request, d_id): deploy = Deploy.objects.filter(pk=d_id).first() if not deploy: diff --git a/spug_api/apps/exec/views.py b/spug_api/apps/exec/views.py index a5d1d8a..f3fd11b 100644 --- a/spug_api/apps/exec/views.py +++ b/spug_api/apps/exec/views.py @@ -14,7 +14,8 @@ import json class TemplateView(View): - @auth('exec.template.view') + @auth('exec.template.view|exec.task.do|schedule.schedule.add|schedule.schedule.edit|\ + monitor.monitor.add|monitor.monitor.edit') def get(self, request): templates = ExecTemplate.objects.all() types = [x['type'] for x in templates.order_by('type').values('type').distinct()] diff --git a/spug_api/apps/host/group.py b/spug_api/apps/host/group.py index 516446b..e0eabbc 100644 --- a/spug_api/apps/host/group.py +++ b/spug_api/apps/host/group.py @@ -39,7 +39,6 @@ def filter_by_perm(data, result, ids): class GroupView(View): - @auth('host.host.view|host.console.view|exec.task.do') def get(self, request): with_hosts = request.GET.get('with_hosts') data, data2 = dict(), dict() diff --git a/spug_api/apps/host/views.py b/spug_api/apps/host/views.py index b35c454..db7c963 100644 --- a/spug_api/apps/host/views.py +++ b/spug_api/apps/host/views.py @@ -20,7 +20,6 @@ import uuid class HostView(View): - @auth('host.host.view|exec.task.do') def get(self, request): hosts = Host.objects.select_related('hostextend') if not request.user.is_supper: diff --git a/spug_api/apps/repository/views.py b/spug_api/apps/repository/views.py index a1c0d88..2b20186 100644 --- a/spug_api/apps/repository/views.py +++ b/spug_api/apps/repository/views.py @@ -15,7 +15,7 @@ import json class RepositoryView(View): - @auth('deploy.repository.view') + @auth('deploy.repository.view|deploy.request.add|deploy.request.edit') def get(self, request): deploy_id = request.GET.get('deploy_id') data = Repository.objects.annotate(