update model,index
This commit is contained in:
16
.env
16
.env
@@ -1,15 +1,15 @@
|
||||
COMPOSE_PROJECT_NAME=paperless
|
||||
PAPERLESS_DEBUG=true
|
||||
|
||||
# PAPERLESS_REDIS=redis://localhost:6379
|
||||
PAPERLESS_REDIS=redis://:@123bytech@172.16.100.203:9377
|
||||
PAPERLESS_REDIS=redis://localhost:6379
|
||||
# PAPERLESS_REDIS=redis://:@123bytech@172.16.100.203:9377
|
||||
|
||||
PAPERLESS_DBHOST=172.16.100.203
|
||||
PAPERLESS_DBPORT=5432
|
||||
PAPERLESS_DBNAME=tc_edoc
|
||||
PAPERLESS_DBUSER=tc_edoc
|
||||
PAPERLESS_DBPASS=27M2MV58Re2Y
|
||||
PAPERLESS_DBSSLMODE=prefer
|
||||
# PAPERLESS_DBHOST=172.16.100.203
|
||||
# PAPERLESS_DBPORT=5432
|
||||
# PAPERLESS_DBNAME=tc_edoc
|
||||
# PAPERLESS_DBUSER=tc_edoc
|
||||
# PAPERLESS_DBPASS=27M2MV58Re2Y
|
||||
# PAPERLESS_DBSSLMODE=prefer
|
||||
|
||||
|
||||
URL_UPLOAD_FILE=https://ocr-core-api.tcgroup.vn/api/v1/file/upload
|
||||
|
||||
@@ -484,9 +484,10 @@ def get_permissions_criterias(user: Optional[User] = None):
|
||||
if user is not None:
|
||||
if user.is_superuser: # superusers see all docs
|
||||
user_criterias = []
|
||||
else:
|
||||
user_criterias.append(query.Term("owner_id", user.id))
|
||||
user_criterias.append(
|
||||
query.Term("viewer_id", str(user.id)),
|
||||
)
|
||||
# else:
|
||||
# user_criterias.append(query.Term("owner_id", user.id))
|
||||
# user_criterias.append(
|
||||
# query.Term("viewer_id", str(user.id)),
|
||||
# )
|
||||
user_criterias = []
|
||||
return user_criterias
|
||||
|
||||
@@ -1018,6 +1018,13 @@ class WorkflowTrigger(models.Model):
|
||||
verbose_name=_("has this correspondent"),
|
||||
)
|
||||
|
||||
filter_has_group = models.ManyToManyField(
|
||||
Group,
|
||||
null=True,
|
||||
blank=True,
|
||||
verbose_name=_("has these groups"),
|
||||
)
|
||||
|
||||
class Meta:
|
||||
verbose_name = _("workflow trigger")
|
||||
verbose_name_plural = _("workflow triggers")
|
||||
|
||||
@@ -562,12 +562,18 @@ class DocumentViewSet(
|
||||
def thumb(self, request, pk=None):
|
||||
try:
|
||||
doc = Document.objects.get(id=pk)
|
||||
if request.user is not None and not has_perms_owner_aware(
|
||||
request.user,
|
||||
"view_document",
|
||||
doc,
|
||||
):
|
||||
# Allow all users to view thumbnails
|
||||
if request.user is None:
|
||||
return HttpResponseForbidden("Insufficient permissions")
|
||||
|
||||
# Original
|
||||
# if request.user is not None and not has_perms_owner_aware(
|
||||
# request.user,
|
||||
# "view_document",
|
||||
# doc,
|
||||
# ):
|
||||
# return HttpResponseForbidden("Insufficient permissions")
|
||||
|
||||
if doc.storage_type == Document.STORAGE_TYPE_GPG:
|
||||
handle = GnuPG.decrypted(doc.thumbnail_file)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user