X-Git-Url: https://git.llucax.com/z.facultad/75.52/sercom.git/blobdiff_plain/5efa79d526588b8fa5ca8813d6cfb1b586e8c0cd..44dcfb7c771112febabc4a325ef836a7c5614f4b:/sercom/subcontrollers/tarea_fuente/__init__.py diff --git a/sercom/subcontrollers/tarea_fuente/__init__.py b/sercom/subcontrollers/tarea_fuente/__init__.py index 25d773f..1bc0769 100644 --- a/sercom/subcontrollers/tarea_fuente/__init__.py +++ b/sercom/subcontrollers/tarea_fuente/__init__.py @@ -12,6 +12,7 @@ from docutils.core import publish_parts from sercom.subcontrollers import validate as val from sercom.model import TareaFuente from sqlobject import * +from comandos import ComandoFuenteController #}}} #{{{ Configuración @@ -46,7 +47,11 @@ form = TareaFuenteForm() #{{{ Controlador class TareaFuenteController(controllers.Controller, identity.SecureResource): """Basic model admin interface""" - require = identity.has_permission('admin') + require = identity.has_permission('entregar') + + comandos = ComandoFuenteController() + + hide_to_entregar = 1 @expose() def default(self, tg_errors=None): @@ -59,12 +64,14 @@ class TareaFuenteController(controllers.Controller, identity.SecureResource): @expose(template='kid:%s.templates.list' % __name__) @paginate('records') + @identity.require(identity.has_permission('admin')) def list(self): """List records in model""" r = cls.select() return dict(records=r, name=name, namepl=namepl) @expose(template='kid:%s.templates.new' % __name__) + @identity.require(identity.has_permission('admin')) def new(self, **kw): """Create new records in model""" return dict(name=name, namepl=namepl, form=form, values=kw) @@ -72,6 +79,7 @@ class TareaFuenteController(controllers.Controller, identity.SecureResource): @validate(form=form) @error_handler(new) @expose() + @identity.require(identity.has_permission('admin')) def create(self, **kw): """Save or create record to model""" validate_new(kw) @@ -79,6 +87,7 @@ class TareaFuenteController(controllers.Controller, identity.SecureResource): raise redirect('list') @expose(template='kid:%s.templates.edit' % __name__) + @identity.require(identity.has_permission('admin')) def edit(self, id, **kw): """Edit record in model""" r = validate_get(id) @@ -87,6 +96,7 @@ class TareaFuenteController(controllers.Controller, identity.SecureResource): @validate(form=form) @error_handler(edit) @expose() + @identity.require(identity.has_permission('admin')) def update(self, id, **kw): """Save or create record to model""" r = validate_set(id, kw) @@ -100,6 +110,7 @@ class TareaFuenteController(controllers.Controller, identity.SecureResource): return dict(name=name, namepl=namepl, record=r) @expose() + @identity.require(identity.has_permission('admin')) def delete(self, id): """Destroy record in model""" r = validate_get(id)