allow restriction of comments to certain types via type option 'organize.allowcomments'
This commit is contained in:
		
							parent
							
								
									8495eea8ad
								
							
						
					
					
						commit
						f8849ee393
					
				
					 1 changed files with 11 additions and 4 deletions
				
			
		|  | @ -1,5 +1,5 @@ | ||||||
| # | # | ||||||
| #  Copyright (c) 2012 Helmut Merz helmutm@cy55.de | #  Copyright (c) 2014 Helmut Merz helmutm@cy55.de | ||||||
| # | # | ||||||
| #  This program is free software; you can redistribute it and/or modify | #  This program is free software; you can redistribute it and/or modify | ||||||
| #  it under the terms of the GNU General Public License as published by | #  it under the terms of the GNU General Public License as published by | ||||||
|  | @ -50,10 +50,17 @@ class CommentsView(NodeView): | ||||||
| 
 | 
 | ||||||
|     @Lazy |     @Lazy | ||||||
|     def allowed(self): |     def allowed(self): | ||||||
|         if self.isAnonymous: |         if self.virtualTargetObject is None: | ||||||
|             return False |             return False | ||||||
|         return (self.virtualTargetObject is not None and |         opts = (self.globalOptions('organize.allowComments') or | ||||||
|                     self.globalOptions('organize.allowComments')) |                 self.typeOptions('organize.allowComments')) | ||||||
|  |         if not opts: | ||||||
|  |             return False | ||||||
|  |         if opts is True: | ||||||
|  |             opts = [] | ||||||
|  |         if self.isAnonymous and not 'all' in opts: | ||||||
|  |             return False | ||||||
|  |         return True | ||||||
| 
 | 
 | ||||||
|     @Lazy |     @Lazy | ||||||
|     def addUrl(self): |     def addUrl(self): | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue