def set_owner_permissions(resource):
 if resource.polymorphic_ctype:
  if (resource.polymorphic_ctype.name == 'layer'):
   for perm in LAYER_ADMIN_PERMISSIONS:
    assign_perm(perm, resource.owner, resource.layer)
  set_geofence_owner(resource, str(resource.owner))
  for perm in ADMIN_PERMISSIONS:
   assign_perm(perm, resource.owner, resource.get_self_resource())

def set_owner_permissions ( resource ) : if resource . polymorphic_ctype : if ( resource . polymorphic_ctype . name == 'layer' ) : for perm in LAYER_ADMIN_PERMISSIONS : assign_perm ( perm , resource . owner , resource . layer ) set_geofence_owner ( resource , str ( resource . owner ) ) for perm in ADMIN_PERMISSIONS : assign_perm ( perm , resource . owner , resource . get_self_resource ( ) )
assign all admin permissions to the owner .