def department():
 mode = session.s3.hrm.mode
 def prep(r):
  if (mode is not None):
   auth.permission.fail()
  return True
 s3.prep = prep
 if (not auth.s3_has_role(ADMIN)):
  s3.filter = auth.filter_by_root_org(s3db.hrm_department)
 return s3_rest_controller('hrm', resourcename)

def department ( ) : mode = session . s3 . hrm . mode def prep ( r ) : if ( mode is not None ) : auth . permission . fail ( ) return True s3 . prep = prep if ( not auth . s3_has_role ( ADMIN ) ) : s3 . filter = auth . filter_by_root_org ( s3db . hrm_department ) return s3_rest_controller ( 'hrm' , resourcename )
departments controller .