allow for hiding of resources from listing via state; suppress this state checking for admin
This commit is contained in:
		
							parent
							
								
									ba0fc064d0
								
							
						
					
					
						commit
						11f3218ea4
					
				
					 2 changed files with 5 additions and 1 deletions
				
			
		|  | @ -721,6 +721,8 @@ class BaseView(GenericView, I18NView): | ||||||
|         return result |         return result | ||||||
| 
 | 
 | ||||||
|     def checkState(self): |     def checkState(self): | ||||||
|  |         if checkPermission('loops.ManageSite', self.context): | ||||||
|  |             return True | ||||||
|         if not self.allStates: |         if not self.allStates: | ||||||
|             return True |             return True | ||||||
|         for stf in self.allStates: |         for stf in self.allStates: | ||||||
|  |  | ||||||
|  | @ -464,7 +464,9 @@ class ConceptView(BaseView): | ||||||
|         rels = self.context.getResourceRelations() |         rels = self.context.getResourceRelations() | ||||||
|         for r in rels: |         for r in rels: | ||||||
|             if fv.check(r.first): |             if fv.check(r.first): | ||||||
|                 yield ResourceRelationView(r, self.request, contextIsSecond=True) |                 view = ResourceRelationView(r, self.request, contextIsSecond=True) | ||||||
|  |                 if view.checkState(): | ||||||
|  |                     yield view | ||||||
| 
 | 
 | ||||||
|     def resources(self): |     def resources(self): | ||||||
|         return self.getResources() |         return self.getResources() | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue