def get_actions(self, request):
        """
        Define actions by user's permissions.
        """
        actions = super(EntryAdmin, self).get_actions(request)
        if not actions:
            return actions
        if (not request.user.has_perm('zinnia.can_change_author') or
                not request.user.has_perm('zinnia.can_view_all')):
            del actions['make_mine']
        if not request.user.has_perm('zinnia.can_change_status'):
            del actions['make_hidden']
            del actions['make_published']
        if not settings.PING_DIRECTORIES:
            del actions['ping_directories']

        return actions
def get_actions ( self , request ) : actions = super ( EntryAdmin , self ) . get_actions ( request ) if not actions : return actions if ( not request . user . has_perm ( 'zinnia.can_change_author' ) or not request . user . has_perm ( 'zinnia.can_view_all' ) ) : del actions [ 'make_mine' ] if not request . user . has_perm ( 'zinnia.can_change_status' ) : del actions [ 'make_hidden' ] del actions [ 'make_published' ] if not settings . PING_DIRECTORIES : del actions [ 'ping_directories' ] return actions
Define actions by user's permissions.