web/views/actions.py
author sylvain.thenault@logilab.fr
Wed, 18 Feb 2009 18:06:41 +0100
branchtls-sprint
changeset 822 e3d8db01f3f5
parent 786 a261fee1bbde
child 824 a5e6acffde30
permissions -rw-r--r--
test_views fixes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     1
"""Set of HTML base actions
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     2
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     3
:organization: Logilab
401
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
     4
:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     5
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     6
"""
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     7
__docformat__ = "restructuredtext en"
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     8
728
a95b284150d1 first pass to use __select__ instead of __selectors__
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 714
diff changeset
     9
from cubicweb.vregistry import objectify_selector
692
800592b8d39b replace deprecated cubicweb.common.selectors by its new module path (cubicweb.selectors)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 660
diff changeset
    10
from cubicweb.selectors import (
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    11
    yes, one_line_rset, two_lines_rset, one_etype_rset, relation_possible,
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    12
    non_final_entity,
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    13
    authenticated_user, match_user_groups, match_search_state,
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    14
    has_editable_relation, has_permission, has_add_permission,
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    15
    )
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    16
from cubicweb.web.action import Action
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    17
from cubicweb.web.views import linksearch_select_url
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    18
from cubicweb.web.views.baseviews import vid_from_rset
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    19
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    20
_ = unicode
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    21
728
a95b284150d1 first pass to use __select__ instead of __selectors__
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 714
diff changeset
    22
@objectify_selector
775
ed106bb2dcd3 fix selectors argus
sylvain.thenault@logilab.fr
parents: 753
diff changeset
    23
def match_searched_etype(cls, req, rset, **kwargs):
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    24
    return req.match_search_state(rset)
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    25
728
a95b284150d1 first pass to use __select__ instead of __selectors__
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 714
diff changeset
    26
@objectify_selector
775
ed106bb2dcd3 fix selectors argus
sylvain.thenault@logilab.fr
parents: 753
diff changeset
    27
def view_is_not_default_view(cls, req, rset, **kwargs):
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    28
    # interesting if it propose another view than the current one
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    29
    vid = req.form.get('vid')
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    30
    if vid and vid != vid_from_rset(req, rset, cls.schema):
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    31
        return 1
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    32
    return 0
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    33
728
a95b284150d1 first pass to use __select__ instead of __selectors__
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 714
diff changeset
    34
@objectify_selector
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    35
def addable_etype_empty_rset(cls, req, rset, **kwargs):
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    36
    if rset is not None and not rset.rowcount:
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    37
        rqlst = rset.syntax_tree()
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    38
        if len(rqlst.children) > 1:
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    39
            return 0
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    40
        select = rqlst.children[0]
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    41
        if len(select.defined_vars) == 1 and len(select.solutions) == 1:
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    42
            rset._searched_etype = select.solutions[0].itervalues().next()
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    43
            eschema = cls.schema.eschema(rset._searched_etype)
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    44
            if not (eschema.is_final() or eschema.is_subobject(strict=True)) \
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    45
                   and eschema.has_perm(req, 'add'):
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    46
                return 1
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    47
    return 0
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    48
401
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
    49
# generic primary actions #####################################################
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    50
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    51
class SelectAction(Action):
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    52
    """base class for link search actions. By default apply on
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    53
    any size entity result search it the current state is 'linksearch'
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    54
    if accept match.
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    55
    """
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    56
    id = 'select'
707
21a59b468f1a __selectors__ -> __select__
sylvain.thenault@logilab.fr
parents: 696
diff changeset
    57
    __select__ = match_search_state('linksearch') & match_searched_etype()
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    58
    
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    59
    title = _('select')
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    60
    category = 'mainactions'    
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    61
    order = 0
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    62
    
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    63
    def url(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    64
        return linksearch_select_url(self.req, self.rset)
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    65
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    66
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    67
class CancelSelectAction(Action):
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    68
    id = 'cancel'
707
21a59b468f1a __selectors__ -> __select__
sylvain.thenault@logilab.fr
parents: 696
diff changeset
    69
    __select__ = match_search_state('linksearch')
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    70
    
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    71
    title = _('cancel select')
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    72
    category = 'mainactions'
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    73
    order = 10
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    74
    
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    75
    def url(self):
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    76
        target, eid, r_type, searched_type = self.req.search_state[1]
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    77
        return self.build_url(str(eid),
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    78
                              vid='edition', __mode='normal')
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    79
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    80
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    81
class ViewAction(Action):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    82
    id = 'view'
707
21a59b468f1a __selectors__ -> __select__
sylvain.thenault@logilab.fr
parents: 696
diff changeset
    83
    __select__ = (match_search_state('normal') &
21a59b468f1a __selectors__ -> __select__
sylvain.thenault@logilab.fr
parents: 696
diff changeset
    84
                  match_user_groups('users', 'managers') &
21a59b468f1a __selectors__ -> __select__
sylvain.thenault@logilab.fr
parents: 696
diff changeset
    85
                  view_is_not_default_view() & 
21a59b468f1a __selectors__ -> __select__
sylvain.thenault@logilab.fr
parents: 696
diff changeset
    86
                  non_final_entity())
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    87
    
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    88
    title = _('view')
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    89
    category = 'mainactions'    
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
    90
    order = 0
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    91
    
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    92
    def url(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    93
        params = self.req.form.copy()
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    94
        params.pop('vid', None)
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    95
        params.pop('__message', None)
401
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
    96
        return self.build_url(self.req.relative_path(includeparams=False),
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
    97
                              **params)
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    98
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    99
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   100
class ModifyAction(Action):
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   101
    id = 'edit'
707
21a59b468f1a __selectors__ -> __select__
sylvain.thenault@logilab.fr
parents: 696
diff changeset
   102
    __select__ = (match_search_state('normal') &
21a59b468f1a __selectors__ -> __select__
sylvain.thenault@logilab.fr
parents: 696
diff changeset
   103
                  one_line_rset() & 
21a59b468f1a __selectors__ -> __select__
sylvain.thenault@logilab.fr
parents: 696
diff changeset
   104
                  (has_permission('update') | has_editable_relation('add')))
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   105
    
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   106
    title = _('modify')
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   107
    category = 'mainactions'
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   108
    order = 10
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   109
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   110
    def url(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   111
        entity = self.rset.get_entity(self.row or 0, self.col or 0)
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   112
        return entity.absolute_url(vid='edition')
401
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   113
        
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   114
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   115
class MultipleEditAction(Action):
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   116
    id = 'muledit' # XXX get strange conflicts if id='edit'
707
21a59b468f1a __selectors__ -> __select__
sylvain.thenault@logilab.fr
parents: 696
diff changeset
   117
    __select__ = (match_search_state('normal') &
753
17d38f000bea some minor __select__ composition fixes
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 728
diff changeset
   118
                  two_lines_rset() & one_etype_rset() &
707
21a59b468f1a __selectors__ -> __select__
sylvain.thenault@logilab.fr
parents: 696
diff changeset
   119
                  has_permission('update'))
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   120
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   121
    title = _('modify')
401
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   122
    category = 'mainactions'
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   123
    order = 10
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   124
    
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   125
    def url(self):
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   126
        return self.build_url('view', rql=self.rset.rql, vid='muledit')
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   127
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   128
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   129
# generic secondary actions ###################################################
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   130
690
ea613e8a5e4f should add relation_possible selector only if require_permission is in the schema
sylvain.thenault@logilab.fr
parents: 660
diff changeset
   131
class ManagePermissionsAction(Action):
781
323656dd85a9 fix import, use non_final_entity instead of implements('Any')
sylvain.thenault@logilab.fr
parents: 775
diff changeset
   132
    id = 'managepermission'
822
e3d8db01f3f5 test_views fixes
sylvain.thenault@logilab.fr
parents: 786
diff changeset
   133
    __select__ = one_line_rset() & non_final_entity() & match_user_groups('managers')
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   134
401
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   135
    title = _('manage permissions')
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   136
    category = 'moreactions'
401
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   137
    order = 100
690
ea613e8a5e4f should add relation_possible selector only if require_permission is in the schema
sylvain.thenault@logilab.fr
parents: 660
diff changeset
   138
707
21a59b468f1a __selectors__ -> __select__
sylvain.thenault@logilab.fr
parents: 696
diff changeset
   139
    @classmethod
690
ea613e8a5e4f should add relation_possible selector only if require_permission is in the schema
sylvain.thenault@logilab.fr
parents: 660
diff changeset
   140
    def registered(cls, vreg):
710
766c881e101f overridden `registered()` methods must call the base implementation
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 696
diff changeset
   141
        super(ManagePermissionsAction, cls).registered(vreg)
690
ea613e8a5e4f should add relation_possible selector only if require_permission is in the schema
sylvain.thenault@logilab.fr
parents: 660
diff changeset
   142
        if 'require_permission' in vreg.schema:
822
e3d8db01f3f5 test_views fixes
sylvain.thenault@logilab.fr
parents: 786
diff changeset
   143
            cls.__select__ = (one_line_rset() & non_final_entity() &
e3d8db01f3f5 test_views fixes
sylvain.thenault@logilab.fr
parents: 786
diff changeset
   144
                              (match_user_groups('managers')
e3d8db01f3f5 test_views fixes
sylvain.thenault@logilab.fr
parents: 786
diff changeset
   145
                               | relation_possible('require_permission', 'subject', 'EPermission',
e3d8db01f3f5 test_views fixes
sylvain.thenault@logilab.fr
parents: 786
diff changeset
   146
                                                   action='add')))
707
21a59b468f1a __selectors__ -> __select__
sylvain.thenault@logilab.fr
parents: 696
diff changeset
   147
        return super(ManagePermissionsAction, cls).registered(vreg)
21a59b468f1a __selectors__ -> __select__
sylvain.thenault@logilab.fr
parents: 696
diff changeset
   148
    
401
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   149
    def url(self):
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   150
        return self.rset.get_entity(0, 0).absolute_url(vid='security')
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   151
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   152
    
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   153
class DeleteAction(Action):
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   154
    id = 'delete'
786
a261fee1bbde fix used selectors
sylvain.thenault@logilab.fr
parents: 781
diff changeset
   155
    __select__ = has_permission('delete')
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   156
    
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   157
    title = _('delete')
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   158
    category = 'moreactions' 
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   159
    order = 20
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   160
    
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   161
    def url(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   162
        if len(self.rset) == 1:
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   163
            entity = self.rset.get_entity(0, 0)
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   164
            return self.build_url(entity.rest_path(), vid='deleteconf')
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   165
        return self.build_url(rql=self.rset.printable_rql(), vid='deleteconf')
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   166
    
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   167
        
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   168
class CopyAction(Action):
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   169
    id = 'copy'
707
21a59b468f1a __selectors__ -> __select__
sylvain.thenault@logilab.fr
parents: 696
diff changeset
   170
    __select__ = one_line_rset() & has_permission('add')
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   171
    
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   172
    title = _('copy')
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   173
    category = 'moreactions'
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   174
    order = 30
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   175
    
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   176
    def url(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   177
        entity = self.rset.get_entity(self.row or 0, self.col or 0)
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   178
        return entity.absolute_url(vid='copy')
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   179
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   180
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   181
class AddNewAction(MultipleEditAction):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   182
    """when we're seeing more than one entity with the same type, propose to
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   183
    add a new one
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   184
    """
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   185
    id = 'addentity'
707
21a59b468f1a __selectors__ -> __select__
sylvain.thenault@logilab.fr
parents: 696
diff changeset
   186
    __select__ = (match_search_state('normal') &
21a59b468f1a __selectors__ -> __select__
sylvain.thenault@logilab.fr
parents: 696
diff changeset
   187
                  (addable_etype_empty_rset()
728
a95b284150d1 first pass to use __select__ instead of __selectors__
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 714
diff changeset
   188
                   | (two_lines_rset() & one_etype_rset & has_add_permission()))
707
21a59b468f1a __selectors__ -> __select__
sylvain.thenault@logilab.fr
parents: 696
diff changeset
   189
                  )
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   190
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   191
    category = 'moreactions'
401
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   192
    order = 40
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   193
    
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   194
    @property
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   195
    def rsettype(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   196
        if self.rset:
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   197
            return self.rset.description[0][0]
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   198
        return self.rset._searched_etype
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   199
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   200
    @property
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   201
    def title(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   202
        return self.req.__('add a %s' % self.rsettype) # generated msgid
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   203
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   204
    def url(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   205
        return self.build_url('add/%s' % self.rsettype)
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   206
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   207
401
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   208
# logged user actions #########################################################
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   209
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   210
class UserPreferencesAction(Action):
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   211
    id = 'myprefs'
707
21a59b468f1a __selectors__ -> __select__
sylvain.thenault@logilab.fr
parents: 696
diff changeset
   212
    __select__ = authenticated_user()
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   213
    
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   214
    title = _('user preferences')
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   215
    category = 'useractions'
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   216
    order = 10
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   217
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   218
    def url(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   219
        return self.build_url(self.id)
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   220
401
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   221
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   222
class UserInfoAction(Action):
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   223
    id = 'myinfos'
707
21a59b468f1a __selectors__ -> __select__
sylvain.thenault@logilab.fr
parents: 696
diff changeset
   224
    __select__ = authenticated_user()
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   225
    
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   226
    title = _('personnal informations')
401
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   227
    category = 'useractions'
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   228
    order = 20
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   229
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   230
    def url(self):
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   231
        return self.build_url('euser/%s'%self.req.user.login, vid='edition')
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   232
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   233
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   234
class LogoutAction(Action):
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   235
    id = 'logout'
707
21a59b468f1a __selectors__ -> __select__
sylvain.thenault@logilab.fr
parents: 696
diff changeset
   236
    __select__ = authenticated_user()
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   237
    
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   238
    title = _('logout')
401
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   239
    category = 'useractions'
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   240
    order = 30
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   241
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   242
    def url(self):
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   243
        return self.build_url(self.id)
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   244
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   245
    
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   246
# site actions ################################################################
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   247
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   248
class ManagersAction(Action):
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   249
    __abstract__ = True
707
21a59b468f1a __selectors__ -> __select__
sylvain.thenault@logilab.fr
parents: 696
diff changeset
   250
    __select__ = match_user_groups('managers')
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   251
401
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   252
    category = 'siteactions'
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   253
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   254
    def url(self):
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   255
        return self.build_url(self.id)
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   256
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   257
    
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   258
class SiteConfigurationAction(ManagersAction):
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   259
    id = 'siteconfig'
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   260
    title = _('site configuration')
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   261
    order = 10
401
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   262
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   263
    
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   264
class ManageAction(ManagersAction):
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   265
    id = 'manage'
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   266
    title = _('manage')
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   267
    order = 20
401
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   268
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   269
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   270
class ViewSchemaAction(Action):
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   271
    id = 'schema'
707
21a59b468f1a __selectors__ -> __select__
sylvain.thenault@logilab.fr
parents: 696
diff changeset
   272
    __select__ = yes()
631
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   273
    
99f5852f8604 major selector refactoring (mostly to avoid looking for select parameters on the target class), start accept / interface unification)
sylvain.thenault@logilab.fr
parents: 554
diff changeset
   274
    title = _("site schema")
401
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   275
    category = 'siteactions'
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   276
    order = 30
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   277
    
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   278
    def url(self):
bc55a104d636 cleanup, backport manage perm action from jpl
sylvain.thenault@logilab.fr
parents: 328
diff changeset
   279
        return self.build_url(self.id)