action:

@auth.requires_login()
def remove_the_record():
      .....
      if auth.has_permission('delete', 'whatever', record_id):
             #remove the actual record
             return 1
      else:
             return 0



callback:

def dontdelete(s):
     if whatever:
          #you can't delete it
          return True


db.table._before_delete.append(lambda s: dontdelete(s))




On Thursday, August 7, 2014 1:57:18 PM UTC+2, Manuele wrote:
>
> Hi! 
> what's the quickest way to block a record removal to all users. I need 
> an easy method to insert the block and even easy to remove... 
>
> I hope I've been clear enough :) 
>
> Thanks in advance 
> Cheers 
>
>      Manuele 
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to