コード例 #1
0
ファイル: __init__.py プロジェクト: qroques/indico
def _extend_event_management_menu(sender, event, **kwargs):
    if not can_manage_attachments(event, session.user):
        return
    return SideMenuItem('attachments',
                        _('Materials'),
                        url_for('attachments.management', event),
                        80,
                        section='organization')
コード例 #2
0
    def can_access(self, user, *args, **kwargs):
        """Check if the user is allowed to access the attachment.

        This is the case if the user has access to see the attachment
        or if the user can manage attachments for the linked object.
        """
        return (super().can_access(user, *args, **kwargs)
                or can_manage_attachments(self.folder.object, user))
コード例 #3
0
ファイル: attachments.py プロジェクト: OmeGak/indico
    def can_access(self, user, *args, **kwargs):
        """Checks if the user is allowed to access the attachment.

        This is the case if the user has access to see the attachment
        or if the user can manage attachments for the linked object.
        """
        return (super(Attachment, self).can_access(user, *args, **kwargs) or
                can_manage_attachments(self.folder.object, user))
コード例 #4
0
    def can_access(self, user, *args, **kwargs):
        """Checks if the user is allowed to access the folder.

        This is the case if the user has access the folder or if the
        user can manage attachments for the linked object.
        """
        return (super(AttachmentFolder, self).can_access(
            user, *args, **kwargs)
                or can_manage_attachments(self.linked_object, user))
コード例 #5
0
    def can_access(self, user, *args, **kwargs):
        """Check if the user is allowed to access the folder.

        This is the case if the user has access the folder or if the
        user can manage attachments for the linked object.
        """
        return (super().can_access(user, *args, **kwargs)
                or can_manage_attachments(self.object,
                                          user,
                                          allow_admin=kwargs.get(
                                              'allow_admin', True)))
コード例 #6
0
ファイル: __init__.py プロジェクト: qroques/indico
def _get_event_management_url(event, **kwargs):
    if can_manage_attachments(event, session.user):
        return url_for('attachments.management', event)
コード例 #7
0
ファイル: event.py プロジェクト: qroques/indico
 def _check_access(self):
     RHProtected._check_access(self)
     if not can_manage_attachments(self.object, session.user):
         raise Forbidden
     check_event_locked(self, self.event)
コード例 #8
0
ファイル: category.py プロジェクト: qroques/indico
 def _check_access(self):
     RHManageCategoryBase._check_access(self)
     # This is already covered by CategModifBase, but if we ever add more
     # checks to can_manage_attachments we are on the safe side...
     if not can_manage_attachments(self.object, session.user):
         raise Forbidden
コード例 #9
0
ファイル: event.py プロジェクト: MichelCordeiro/indico
 def _checkProtection(self):
     RHProtected._checkProtection(self)
     if not can_manage_attachments(self.object, session.user):
         raise Forbidden
コード例 #10
0
 def can_manage_attachments(self, user):
     return can_manage_attachments(self, user)
コード例 #11
0
ファイル: attachments.py プロジェクト: belokop/indico_bare
 def can_manage_attachments(self, user):
     return can_manage_attachments(self, user)
コード例 #12
0
ファイル: category.py プロジェクト: OmeGak/indico
 def _checkProtection(self):
     RHManageCategoryBase._checkProtection(self)
     # This is already covered by CategModifBase, but if we ever add more
     # checks to can_manage_attachments we are on the safe side...
     if not can_manage_attachments(self.object, session.user):
         raise Forbidden
コード例 #13
0
ファイル: __init__.py プロジェクト: DirkHoffmann/indico
def _get_event_management_url(event, **kwargs):
    if can_manage_attachments(event, session.user):
        return url_for('attachments.management', event)
コード例 #14
0
ファイル: __init__.py プロジェクト: DirkHoffmann/indico
def _extend_event_management_menu(sender, event, **kwargs):
    if not can_manage_attachments(event, session.user):
        return
    return SideMenuItem('attachments', _('Materials'), url_for('attachments.management', event), 80,
                        section='organization')
コード例 #15
0
 def can_manage_attachments(self, user):
     from indico.modules.attachments.util import can_manage_attachments
     return can_manage_attachments(self, user)
コード例 #16
0
ファイル: attachments.py プロジェクト: fph/indico
 def can_manage_attachments(self, user):
     from indico.modules.attachments.util import can_manage_attachments
     return can_manage_attachments(self, user)
コード例 #17
0
 def _checkProtection(self):
     RHProtected._checkProtection(self)
     if not can_manage_attachments(self.object, session.user):
         raise Forbidden