Ignore:
Timestamp:
27 Nov 2014, 07:48:15 (10 years ago)
Author:
Henrik Bettermann
Message:

Add local role ProductManager?.

We don't need local roles for the products container.

Location:
main/waeup.ikoba/trunk/src/waeup/ikoba
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/permissions.py

    r12065 r12068  
    7878    grok.title(u'Owner')
    7979    grok.permissions('waeup.editUser')
     80
     81class ProductManager(grok.Role):
     82    grok.name('waeup.local.ProductManager')
     83    grok.title(u'Product Manager')
     84    grok.permissions('waeup.manageProducts',
     85                     'waeup.viewProducts',
     86                     'waeup.exportData')
    8087
    8188# Site Roles
  • main/waeup.ikoba/trunk/src/waeup/ikoba/permissions.txt

    r11958 r12068  
    4242
    4343    >>> len(list(get_waeup_roles(also_local=True)))
    44     15
     44    16
    4545
    4646
  • main/waeup.ikoba/trunk/src/waeup/ikoba/products/browser.py

    r12067 r12068  
    9292    taboneactions = [_('Save'),_('Cancel')]
    9393    tabtwoactions = [_('Add product'), _('Remove selected'),_('Cancel')]
    94     tabthreeactions1 = [_('Remove selected local roles')]
    95     tabthreeactions2 = [_('Add local role')]
    9694
    9795    @jsaction(_('Remove selected'))
     
    117115        self.redirect(self.url(self.context, '@@addproduct'))
    118116        return
    119 
    120     @action(_('Add local role'), validator=NullValidator)
    121     def addLocalRole(self, **data):
    122         return add_local_role(self,3,**data)
    123 
    124     @action(_('Remove selected local roles'))
    125     def delLocalRoles(self, **data):
    126         return del_local_roles(self,3,**data)
    127117
    128118
  • main/waeup.ikoba/trunk/src/waeup/ikoba/products/browser_templates/containermanagepage.pt

    r12067 r12068  
    1111      <span i18n:translate="">Products
    1212      </span> </a>
    13     </li>
    14     <li>
    15     <a href="#tab3" data-toggle="tab">
    16       <span i18n:translate="">Local Roles
    17       </span></a>
    1813    </li>
    1914  </ul>
     
    6358      </div>
    6459    </div>
    65     <div id="tab3" class="tab-pane"> <br />
    66       <table class="ikoba-data-table dataTableManage">
    67         <thead>
    68           <tr>
    69             <th>&nbsp;
    70             </th>
    71             <th i18n:translate="">User Id
    72             </th>
    73             <th i18n:translate="">Name
    74             </th>
    75             <th i18n:translate="">Local Role
    76             </th>
    77           </tr>
    78         </thead>
    79         <tbody>
    80           <tr tal:repeat="entry view/getUsersWithLocalRoles">
    81             <td>
    82               <input type="checkbox" name="role_id"
    83               tal:attributes="value python: entry['user_name']+'|'+entry['local_role']" /> </td>
    84             <td tal:content="entry/user_name"> USERNAME </td>
    85             <td tal:content="entry/user_title"> USERTITLE </td>
    86             <td tal:content="entry/local_role_title"> LOCAL ROLE </td>
    87           </tr>
    88         </tbody>
    89       </table>
    90       <div tal:condition="view/availableActions">
    91         <span tal:repeat="action view/actions" tal:omit-tag="">
    92           <input tal:condition="python:action.label in view.tabthreeactions1"
    93                  tal:replace="structure action/render"/>
    94         </span>
    95       </div><br /><br />
    96       <div class="form-inline">
    97         <br />
    98         <div class="form-group">
    99           <select id="user" name="user" class="form-control">
    100             <option tal:repeat="user view/getUsers"
    101                     tal:attributes="value user/name">
    102             <span tal:replace="user/val/title">USERTITLE
    103             </span>
    104             </option>
    105           </select>
    106         </div>
    107         <div class="form-group">
    108           <select id="local_role" name="local_role" class="form-control">
    109             <option tal:repeat="localrole view/getLocalRoles"
    110                     tal:attributes="value localrole/name">
    111             <span tal:replace="localrole/title">LOCALROLETITLE
    112             </span>
    113             </option>
    114           </select>
    115         </div>
    116         <div class="form-group" tal:condition="view/availableActions">
    117           <span tal:repeat="action view/actions" tal:omit-tag="">
    118             <input tal:condition="python:action.label in view.tabthreeactions2"
    119                    tal:replace="structure action/render"/>
    120           </span>
    121         </div>
    122       </div>
    123 
    124     </div>
    12560  </div>
    12661</form>
  • main/waeup.ikoba/trunk/src/waeup/ikoba/products/product.py

    r12066 r12068  
    3939    grok.implements(IProduct)
    4040    grok.provides(IProduct)
    41     grok.baseclass()
     41    #grok.baseclass()
     42
     43    local_roles = [
     44        'waeup.local.ProductManager',
     45        ]
    4246
    4347Product = attrs_to_fields(Product)
Note: See TracChangeset for help on using the changeset viewer.