Project

General

Profile

Actions

Feature #8292

closed

Modify permissions for tags

Added by Anton Vasilyev over 7 years ago. Updated over 7 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 1 (1 open0 closed)

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

Actions
Actions #1

Updated by Evgeny Novikov over 7 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.

Actions #2

Updated by Vladimir Gratinskiy over 7 years ago

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

Implemented in feature_8292.

Actions #3

Updated by Evgeny Novikov over 7 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!

Actions #4

Updated by Evgeny Novikov over 7 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.

Actions

Also available in: Atom PDF