Index: main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py	(revision 5936)
+++ main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py	(revision 5937)
@@ -29,4 +29,5 @@
 from zope.component import getUtility, getAllUtilitiesRegisteredFor
 from zope.formlib.widgets import FileWidget, DateWidget
+from zope.securitypolicy.interfaces import IPrincipalRoleManager
 from waeup.sirp.browser import (
     WAeUPPage, WAeUPEditFormPage, WAeUPAddFormPage,
@@ -313,7 +314,11 @@
             applicant.access_code = pin
             self.context[pin] = applicant
-            # XXX: set owner role on created applicant
-
-        self.redirect(self.url(self.context[pin]))
+            
+        # Assign current principal the owner role on created applicant
+        # record
+        role_manager = IPrincipalRoleManager(self.context)
+        role_manager.assignRoleToPrincipal(
+            'waeup.ApplicationOwner', self.request.principal.id)
+        self.redirect(self.url(self.context[pin], 'edit'))
         return
 
@@ -345,4 +350,5 @@
     grok.context(IApplicant)
     grok.name('index')
+    grok.require('waeup.viewApplication')
     form_fields = grok.AutoFields(IApplicant)
     form_fields['fst_sit_results'].custom_widget = list_results_display_widget
@@ -357,4 +363,5 @@
     grok.context(IApplicant)
     grok.name('edit')
+    grok.require('waeup.editApplication')
     form_fields = grok.AutoFields(IApplicantPDEEditData)
     #form_fields['passport'].custom_widget = FileWidget
Index: main/waeup.sirp/trunk/src/waeup/sirp/applicants/jambtables/tests/test_browser.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/applicants/jambtables/tests/test_browser.py	(revision 5937)
+++ main/waeup.sirp/trunk/src/waeup/sirp/applicants/jambtables/tests/test_browser.py	(revision 5937)
@@ -0,0 +1,62 @@
+##
+## test_browser.py
+## Login : <uli@pu.smp.net>
+## Started on  Wed Feb 23 09:43:19 2011 Uli Fouquet
+## $Id$
+## 
+## Copyright (C) 2011 Uli Fouquet
+## 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
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+## 
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+## 
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+import unittest
+from waeup.sirp.testing import WAeUPSIRPUnitTestLayer
+
+class LoginPDETestCase(unittest.TestCase):
+
+    layer = WAeUPSIRPUnitTestLayer
+
+    def setUp(self):
+        pass
+        
+    def tearDown(self):
+        pass
+
+    def test_blah(self):
+        from waeup.sirp.app import University
+        u = University()
+        self.assertTrue('jambdata' in u.keys())
+
+    def test_foo(self):
+        from waeup.sirp.app import University
+        u = University()
+        self.assertTrue('jambdata' in u.keys())
+
+    def test_bar(self):
+        from waeup.sirp.app import University
+        u = University()
+        self.assertTrue('jambdata' in u.keys())
+
+
+
+def test_suite():
+    suite = unittest.TestSuite()
+    for testcase in [
+        LoginPDETestCase,
+        ]:
+        suite.addTest(
+            unittest.TestLoader().loadTestsFromTestCase(
+                testcase,
+                ),
+            )
+    return suite
Index: main/waeup.sirp/trunk/src/waeup/sirp/permissions.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/permissions.py	(revision 5936)
+++ main/waeup.sirp/trunk/src/waeup/sirp/permissions.py	(revision 5937)
@@ -30,5 +30,19 @@
 class FacultyRead(grok.Permission):
     grok.name('waeup.facultyread')
-    
+
+# Application permissions
+class ViewApplication(grok.Permission):
+    grok.name('waeup.viewApplication')
+
+class ViewFullApplication(grok.Permission):
+    grok.name('waeup.viewFullApplication')
+
+class EditApplication(grok.Permission):
+    grok.name('waeup.editApplication')
+
+class EditFullApplication(grok.Permission):
+    grok.name('waeup.editFullApplication')
+
+# Roles
 class PortalUser(grok.Role):
     grok.name('waeup.PortalUser')
@@ -40,4 +54,8 @@
                      'waeup.View', 'waeup.Public','waeup.manageACBatches')
 
+class ApplicationOwner(grok.Role):
+    grok.name('waeup.ApplicationOwner')
+    grok.permissions('waeup.viewApplication', 'waeup.editApplication')
+    
 def getRoles():
     app = grok.getSite()
