Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ LOW PRIO
## Requirements

- Python3.0+
- Django2.0+
- Django3.0+

## Installation

Expand All @@ -169,18 +169,19 @@ sudo -u postgres psql
postgres=# create database panopticum;
postgres=# create user panopticum with encrypted password 'my secret password';
postgres=# grant all privileges on database panopticum to panopticum;
sudo echo "host all all 127.0.0.1/32 md5" > /var/lib/pgsql/11/data/pg_hba.conf
sudo sh -c 'host all all 127.0.0.1/32 md5" > /var/lib/pgsql/11/data/pg_hba.conf'
sudo systemctl restart postgresql-11
```

### Install python3

CentOS-7:
```
sudo yum -y install https://centos7.iuscommunity.org/ius-release.rpm
sudo yum -y install https://repo.ius.io/ius-release-el7.rpm
sudo yum -y install python36
sudo yum -y install python36-pip
sudo yum -y install python36-psycopg2
sudo yum -y install openssl-devel gcc python3-devel openldap-devel graphviz-devel

```

Expand Down
22 changes: 22 additions & 0 deletions panopticum/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,22 @@ class ComponentDependencyAdmin(admin.TabularInline):
verbose_name = "Component Dependency"
verbose_name_plural = "Component Dependencies"

def has_change_permission(self, request, obj=None):
""" Allow change requirement if user have permissions """
return request.user.has_perm(SIGNEE_STATUS_PERMISSION) or \
(request.user.has_perm(OWNER_STATUS_PERMISSION) and
obj and request.user == obj.owner_maintainer)

def _has_add_permission(self, request, obj=None):
return True;

def has_add_permission(self, request, obj=None):
return self.has_change_permission(request, obj)

def has_delete_permission(self, request, obj=None):
return False



class TCPPortAdmin(admin.ModelAdmin):
search_fields = ['port', ]
Expand All @@ -87,6 +103,9 @@ class ComponentDeploymentAdmin(admin.TabularInline):
verbose_name_plural = "Component Deployments"
autocomplete_fields = ['open_ports', ]

def _has_add_permission(self, request, obj=None):
return True;


class RequirementInlineAdmin(admin.TabularInline):
model = Requirement
Expand Down Expand Up @@ -208,6 +227,9 @@ class RequirementStatusEntryAdmin(admin.TabularInline):
extra = 1
verbose_name_plural = "Requirements"

def _has_add_permission(self, request, obj=None):
return True;

def requirement(self, obj):
return obj.name

Expand Down
2 changes: 0 additions & 2 deletions panopticum/models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import django.forms
from django.db import models
from datatableview.views import DatatableView
from datatableview import helpers
from django.forms.models import model_to_dict
import datetime
from django.contrib.auth.models import AbstractUser, Group
Expand Down
2 changes: 0 additions & 2 deletions panopticum/templates/dashboard/team.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
$(document).ready(function() {

ELEMENT.locale(ELEMENT.lang.en);
{% include "vue/widget-note.js" %}
{% include "vue/widget-jira-ticket.js" %}
{% include "vue/status.js" %}
{% include "vue/wdget-status-popover.js" %}
{% include "vue/widget-components-list.js" %}
Expand Down
2 changes: 0 additions & 2 deletions panopticum/templates/page/component.html
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,6 @@
function vue_component_init() {

var url = `/api${window.location.pathname}/?format=json`
{% include "vue/widget-jira-ticket.js" %}
{% include "vue/widget-note.js" %}
{% include "vue/status.js" %}
{% include "vue/widget-requirements.js" %}
{% include "vue/widget-signoff.js" %}
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Django==2.1.*
Django==3.1.4
django-auth-ldap
django-cors-headers
django-datatable-view
django-extensions
django-filter
django-modeladmin-reorder
Expand All @@ -18,4 +17,5 @@ pillow
scalpl
iso3166
django-database-files-3000
git+https://github.com/den-gts/django-atlassian.git
git+https://github.com/den-gts/django-atlassian.git
cryptography==2.9.1