Merge branch 'master' into bbmaster
This commit is contained in:
		
						commit
						0263eacb3b
					
				
					 3 changed files with 27 additions and 18 deletions
				
			
		|  | @ -68,6 +68,7 @@ from loops.config.base import DummyOptions | ||||||
| from loops.i18n.browser import I18NView | from loops.i18n.browser import I18NView | ||||||
| from loops.interfaces import IResource, IView, INode, ITypeConcept | from loops.interfaces import IResource, IView, INode, ITypeConcept | ||||||
| from loops.organize.tracking import access | from loops.organize.tracking import access | ||||||
|  | from loops.organize.util import getRolesForPrincipal | ||||||
| from loops.resource import Resource | from loops.resource import Resource | ||||||
| from loops.security.common import checkPermission | from loops.security.common import checkPermission | ||||||
| from loops.security.common import canAccessObject, canListObject, canWriteObject | from loops.security.common import canAccessObject, canListObject, canWriteObject | ||||||
|  | @ -780,7 +781,16 @@ class BaseView(GenericView, I18NView): | ||||||
| 
 | 
 | ||||||
|     @Lazy |     @Lazy | ||||||
|     def showObjectActions(self): |     def showObjectActions(self): | ||||||
|         return not IUnauthenticatedPrincipal.providedBy(self.request.principal) |         principal = self.request.principal | ||||||
|  |         if IUnauthenticatedPrincipal.providedBy(principal): | ||||||
|  |             return False | ||||||
|  |         perms = self.globalOptions('action.object.permissions') | ||||||
|  |         if perms: | ||||||
|  |             for p in perms: | ||||||
|  |                 if checkPermission(p, self.context): | ||||||
|  |                     return True | ||||||
|  |             return False | ||||||
|  |         return True | ||||||
| 
 | 
 | ||||||
|     def checkAction(self, name, category, target): |     def checkAction(self, name, category, target): | ||||||
|         if name in ('create_resource',): |         if name in ('create_resource',): | ||||||
|  |  | ||||||
|  | @ -25,30 +25,29 @@ | ||||||
|       <tal:title condition="not:view/isInnerHtml"> |       <tal:title condition="not:view/isInnerHtml"> | ||||||
|         <h1 tal:content="request/view_title|view/title" |         <h1 tal:content="request/view_title|view/title" | ||||||
|             i18n:translate="">Edit Information Object</h1> |             i18n:translate="">Edit Information Object</h1> | ||||||
|         <br /> |  | ||||||
|       </tal:title> |       </tal:title> | ||||||
| 
 | 
 | ||||||
|       <table cellpadding="3" class="form"> |       <table cellpadding="3" class="form"> | ||||||
|         <tbody> |         <tbody tal:condition="view/isInnerHtml"> | ||||||
|           <tr tal:condition="view/isInnerHtml"> |           <tr> | ||||||
|             <th colspan="5" class="headline" |             <th colspan="5" class="headline" | ||||||
|                 tal:attributes="colspan python: useI18N and 4 or 5"> |                 tal:attributes="colspan python: useI18N and 4 or 5"> | ||||||
|               <span tal:content="request/view_title|view/title" |               <span tal:content="request/view_title|view/title" | ||||||
|                     i18n:translate="">Edit Information Object</span> |                     i18n:translate="">Edit Information Object</span> | ||||||
|             </th> |             </th> | ||||||
|           <th tal:condition="useI18N" |             <th tal:condition="useI18N" | ||||||
|               style="vertical-align: bottom; text-align: right; |                 style="vertical-align: bottom; text-align: right; | ||||||
|                      padding-right: 1em"> |                        padding-right: 1em"> | ||||||
|             <select name="loops.language" id="loops.language" |               <select name="loops.language" id="loops.language" | ||||||
|                     tal:attributes="onChange |                       tal:attributes="onChange | ||||||
|                             string:return replaceFieldsNodeForLanguage( |                               string:return replaceFieldsNodeForLanguage( | ||||||
|                                     'form.fields', 'loops.language', |                                       'form.fields', 'loops.language', | ||||||
|                                     '${view/virtualTargetUrl}/$innerForm')"> |                                       '${view/virtualTargetUrl}/$innerForm')"> | ||||||
|               <option tal:repeat="lang languages" |                 <option tal:repeat="lang languages" | ||||||
|                       tal:content="lang" |                         tal:content="lang" | ||||||
|                       tal:attributes="selected python: lang == language;">en</option> |                         tal:attributes="selected python: lang == language;">en</option> | ||||||
|             </select> |               </select> | ||||||
|           </th> |             </th> | ||||||
|         </tr></tbody> |         </tr></tbody> | ||||||
| 
 | 
 | ||||||
|         <tbody metal:define-slot="custom_header" /> |         <tbody metal:define-slot="custom_header" /> | ||||||
|  |  | ||||||
|  | @ -138,7 +138,7 @@ class BaseMemberRegistration(NodeView): | ||||||
|         name = '.'.join((self.text_names_prefix, self.info_key)) |         name = '.'.join((self.text_names_prefix, self.info_key)) | ||||||
|         text = self.resourceManager.get(name) |         text = self.resourceManager.get(name) | ||||||
|         if text: |         if text: | ||||||
|             return self.renderText(text.data) |             return self.renderText(text.data, text.contentType) | ||||||
|         return u'' |         return u'' | ||||||
| 
 | 
 | ||||||
|     @Lazy |     @Lazy | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue