[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Nuxeo-checkins] CVS: NuxForum CatalogAware.py,1.1,1.2 Forum.py,1.6,1.7
From: |
Juan David Ibáñez Palomar |
Subject: |
[Nuxeo-checkins] CVS: NuxForum CatalogAware.py,1.1,1.2 Forum.py,1.6,1.7 Posting.py,1.3,1.4 |
Date: |
Tue, 14 May 2002 12:22:01 -0400 |
Update of /cvsroot/nuxeo/NuxForum
In directory subversions:/tmp/cvs-serv9500
Modified Files:
CatalogAware.py Forum.py Posting.py
Log Message:
Fixes..
Index: CatalogAware.py
===================================================================
RCS file: /cvsroot/nuxeo/NuxForum/CatalogAware.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** CatalogAware.py 6 May 2002 17:22:56 -0000 1.1
--- CatalogAware.py 14 May 2002 16:21:55 -0000 1.2
***************
*** 36,43 ****
def get_catalogs(self):
try:
! catalogs = getattr(self, 'ca_catalogs')
except AttributeError:
! catalogs = [self.default_catalog]
! return [ getattr(self, x) for x in catalogs ]
def index_object(self):
--- 36,49 ----
def get_catalogs(self):
try:
! ids = getattr(self, 'ca_catalogs')
except AttributeError:
! ids = [self.default_catalog]
!
! catalogs = []
! for id in ids:
! if hasattr(self, id):
! catalogs.append(getattr(self, id))
!
! return catalogs
def index_object(self):
Index: Forum.py
===================================================================
RCS file: /cvsroot/nuxeo/NuxForum/Forum.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** Forum.py 7 May 2002 17:01:25 -0000 1.6
--- Forum.py 14 May 2002 16:21:55 -0000 1.7
***************
*** 82,87 ****
security.declareProtected('Add forum articles', 'add_article')
! def add_article(self, title, subject, body,
! REQUEST=None, RESPONSE=None):
""" """
id = self.get_id()
--- 82,86 ----
security.declareProtected('Add forum articles', 'add_article')
! def add_article(self, title, subject, body, REQUEST=None, RESPONSE=None):
""" """
id = self.get_id()
***************
*** 114,118 ****
def get_subjects(self):
""" """
-
return self.subjects.objectValues()
--- 113,116 ----
***************
*** 122,133 ****
""" """
manager = getSecurityManager()
! articles = []
for x in range(self.count):
! article = getattr(self.articles, str(x))
! if manager.checkPermission('View', article):
! articles.append(article)
! articles.reverse()
! return articles
--- 120,131 ----
""" """
manager = getSecurityManager()
! postings = []
for x in range(self.count):
! posting = getattr(self.articles, str(x))
! if manager.checkPermission('View', posting):
! postings.append(posting)
! postings.reverse()
! return postings
Index: Posting.py
===================================================================
RCS file: /cvsroot/nuxeo/NuxForum/Posting.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** Posting.py 6 May 2002 17:09:46 -0000 1.3
--- Posting.py 14 May 2002 16:21:55 -0000 1.4
***************
*** 28,32 ****
# Zope
from Globals import InitializeClass
! from AccessControl import ClassSecurityInfo
# Products
--- 28,32 ----
# Zope
from Globals import InitializeClass
! from AccessControl import ClassSecurityInfo, getSecurityManager
# Products
***************
*** 69,73 ****
def get_number_of_comments(self):
"""Returns the total number of comments to this post."""
-
n = self.count
for comment in self.get_comments():
--- 69,72 ----
***************
*** 79,84 ****
def get_comments(self):
""" """
! return [ getattr(self, str(x)) for x in range(self.count) ]
--- 78,90 ----
def get_comments(self):
""" """
! manager = getSecurityManager()
! postings = []
! for x in range(self.count):
! posting = getattr(self, str(x))
! if manager.checkPermission('View', posting):
! postings.append(posting)
! postings.reverse()
+ return postings
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Nuxeo-checkins] CVS: NuxForum CatalogAware.py,1.1,1.2 Forum.py,1.6,1.7 Posting.py,1.3,1.4,
Juan David Ibáñez Palomar <=