Index: /main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py	(revision 6125)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py	(revision 6126)
@@ -14,5 +14,4 @@
 from hurry.workflow.interfaces import NoTransitionAvailableError
 from zope import schema
-from waeup.sirp.browser.resources import warning, datepicker, tabs, datatable
 try:
     from zope.authentication.interfaces import (
@@ -22,4 +21,5 @@
     from zope.app.security.interfaces import (
         IAuthentication, IUnauthenticatedPrincipal, ILogout)
+from zope.securitypolicy.interfaces import IPrincipalRoleManager, IPrincipalRoleMap
 from zope.component import (
     getUtility, createObject,getAllUtilitiesRegisteredFor)
@@ -27,5 +27,5 @@
 from zope.exceptions import DuplicationError
 from zope.session.interfaces import ISession
-
+from waeup.sirp.browser.resources import warning, datepicker, tabs, datatable
 from waeup.sirp.browser import (
     WAeUPPage, WAeUPEditFormPage, WAeUPAddFormPage,
@@ -40,4 +40,5 @@
     IWAeUPXMLImporter, IWAeUPXMLExporter, IBatchProcessor)
 from waeup.sirp.university.catalog import search
+from waeup.sirp.university.faculty import local_roles as faculty_local_roles
 from waeup.sirp.university.vocabularies import course_levels
 from waeup.sirp.widgets.restwidget import ReSTDisplayWidget
@@ -950,5 +951,5 @@
     @grok.action('Cancel')
     def cancel(self, **data):
-        self.redirect(self.url(self.context))   
+        self.redirect(self.url(self.context))
 
 #class RemoveFacultyFormPage(RemoveFormPage):
@@ -986,5 +987,5 @@
     #        except:
     #            self.flash('Could not delete %s.' % code)
-
+    
 class FacultyManageFormPage(WAeUPEditFormPage):
     """Manage the basic properties of a `Faculty` instance.
@@ -997,4 +998,5 @@
     taboneactions = ['Save','Cancel']
     tabtwoactions = ['Add department', 'Remove selected','Cancel']
+    tabthreeactions = ['Add local role']
     subunits = 'Departments'
 
@@ -1007,5 +1009,17 @@
     @property
     def title(self):
-        return self.context.longtitle()        
+        return self.context.longtitle()
+
+    def getLocalRoles(self):
+        #import pdb; pdb.set_trace()
+        return faculty_local_roles
+        
+    def getUsers(self):
+        """Get a list of all users.
+        """
+        for key, val in grok.getSite()['users'].items():
+            url = self.url(val)
+            #import pdb; pdb.set_trace()
+            yield(dict(url=url, name=key, val=val))
 
     def update(self):
@@ -1048,5 +1062,16 @@
         self.redirect(self.url(self.context))
         return
-
+        
+    @grok.action('Add local role', validator=NullValidator)
+    def addLocalRole(self, **data):
+        form = self.request.form
+        localrole = form['local_role']
+        user = form['user']
+        role_manager = IPrincipalRoleManager(self.context)
+        role_map = IPrincipalRoleMap(self.context)
+        #import pdb; pdb.set_trace()
+        role_manager.assignRoleToPrincipal(localrole, user)
+        self.redirect(self.url(self.context, u'@@manage')+'#tab-3')
+        return
 
 class DepartmentAddFormPage(WAeUPAddFormPage):
Index: /main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/facultymanagepage.pt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/facultymanagepage.pt	(revision 6125)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/facultymanagepage.pt	(revision 6126)
@@ -26,4 +26,5 @@
   <li><a href="#tab-1"><span>Settings</span></a></li>
   <li><a href="#tab-2"><span tal:content="view/subunits">Contents</span></a></li>
+  <li><a href="#tab-3"><span>Local Roles</span></a></li>
 </ul>
    
@@ -111,6 +112,46 @@
         </span>
     </div>      
-  
 </div>
+
+<div id="tab-3">
+    <h3>Manage local roles</h3>
+    <table class="zebra">
+    <tr>
+        <td>
+        <label for="users">User:</label>
+        </td>
+        <td>
+            <select  id="user" name="user"  tal:repeat="user view/getUsers">
+              <option tal:attributes="value user/name">
+                <span tal:replace="user/val/description">USERTITLE</span>
+              </option>
+            </select>
+        </td>
+    </tr>
+    <tr>
+        <td>
+        <label for="local_roles">Local Role:</label>
+        </td>
+        <td>
+            <select  id="local_role" name="local_role"  tal:repeat="localrole view/getLocalRoles">
+              <option tal:attributes="value localrole/name">
+                <span tal:replace="localrole/title">LOCALROLETITLE</span>
+              </option>
+            </select>
+        </td>
+    </tr>
+    </table>
+
+    <div id="actionsView">
+        <span class="actionButtons" tal:condition="view/availableActions">
+            <span tal:repeat="action view/actions"
+                  tal:omit-tag="">
+              <input tal:condition="python:action.label in view.tabthreeactions"
+                     tal:replace="structure action/render"/>
+            </span>
+        </span>
+    </div>
+</div>
+
 </div>
 </form>  
