@core_helper
def user_in_org_or_group(group_id):
 if (not c.userobj):
  return False
 if c.userobj.sysadmin:
  return True
 query = model.Session.query(model.Member).filter((model.Member.state == 'active')).filter((model.Member.table_name == 'user')).filter((model.Member.group_id == group_id)).filter((model.Member.table_id == c.userobj.id))
 return (len(query.all()) != 0)

@ core_helper def user_in_org_or_group ( group_id ) : if ( not c . userobj ) : return False if c . userobj . sysadmin : return True query = model . Session . query ( model . Member ) . filter ( ( model . Member . state == 'active' ) ) . filter ( ( model . Member . table_name == 'user' ) ) . filter ( ( model . Member . group_id == group_id ) ) . filter ( ( model . Member . table_id == c . userobj . id ) ) return ( len ( query . all ( ) ) != 0 )
check if user is in a group or organization .