Project

General

Profile

Feature #8292

Modify permissions for tags

Added by Anton Vasilyev over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Immediate
Category:
Bridge
Target version:
-
Start date:
07/12/2017
Due date:
07/14/2017
% Done:

0%

Estimated time:
Published in build:

Description

Require to change current permission model for tags.

Permissions separates into:
1. modification (edit, delete)
2. child creation

Each tag should have list of users with corresponding permissions.
Manager should have ability to modify these lists.
Author of tag will automatically assigned both permissions.


Related issues

Related to Klever - Feature #8298: Highlight tag rightsNew07/14/2017

Actions

History

#1

Updated by Evgeny Novikov over 2 years ago

  • Category changed from Preset jobs, marks and tags to Bridge
  • Assignee changed from Evgeny Novikov to Vladimir Gratinskiy

Indeed this looks more like a bug. Related issue #8118 wasn't formulated accurately enough. That's why now various operations with tags are complicated. The new suggested model looks to be very generic and will bring us all the necessary capabilities.

#2

Updated by Vladimir Gratinskiy over 2 years ago

  • Due date set to 07/14/2017
  • Status changed from New to Resolved

Implemented in feature_8292.

#3

Updated by Evgeny Novikov over 2 years ago

  • Status changed from Resolved to Open

I caught the following exception:

get() returned more than one UnsafeTagAccess -- it returned 2!
Traceback (most recent call last):
  File "/home/novikov/work/klever/bridge/marks/views.py", line 536, in show_tags
    tags_data = GetTagsData(tags_type, user=request.user)
  File "/home/novikov/work/klever/bridge/marks/tags.py", line 151, in __init__
    self.__get_tags()
  File "/home/novikov/work/klever/bridge/marks/tags.py", line 168, in __get_tags
    [TagData(self.user, tag) for tag in UnsafeTag.objects.filter(**tags_filter).order_by('tag')]
  File "/home/novikov/work/klever/bridge/marks/tags.py", line 168, in <listcomp>
    [TagData(self.user, tag) for tag in UnsafeTag.objects.filter(**tags_filter).order_by('tag')]
  File "/home/novikov/work/klever/bridge/marks/tags.py", line 135, in __init__
    self.can_edit = self._access.edit()
  File "/home/novikov/work/klever/bridge/marks/tags.py", line 60, in edit
    return self._is_manager or self.__has_edit_access()
  File "/home/novikov/work/klever/bridge/marks/tags.py", line 43, in __has_edit_access
    return access_table.objects.get(user=self.user, tag=self.tag).modification
  File "/home/novikov/.pyenv/versions/virtual-env-3.6.1/lib/python3.6/site-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/home/novikov/.pyenv/versions/virtual-env-3.6.1/lib/python3.6/site-packages/django/db/models/query.py", line 383, in get
    (self.model._meta.object_name, num)
marks.models.MultipleObjectsReturned: get() returned more than one UnsafeTagAccess -- it returned 2!

#4

Updated by Evgeny Novikov over 2 years ago

  • Status changed from Open to Closed

I hope that now it works like the most of us agrees with. I merged the branch to master in 3d010b9e.

Also available in: Atom PDF